diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c44f0d3..ef5c4cd 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -6,15 +6,23 @@ on: paths: - "latex/*" - "shared/*" - - "docs/*" - - "docusaurus.config.js" + - "content/*" + - "config/*" permissions: - contents: write + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false jobs: gh-pages: runs-on: ubuntu-latest + env: + HUGO_VERSION: 0.115.4 steps: - uses: actions/checkout@v3 - uses: xu-cheng/texlive-action/full@v1 @@ -28,16 +36,43 @@ jobs: - name: cp pdfs to static/ run: cp latex/cv.pdf latex/certificates.pdf static/ - - uses: actions/setup-node@v3 + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Install Dart Sass + run: sudo snap install dart-sass + - name: Checkout + uses: actions/checkout@v3 with: - node-version: 18 - cache: npm - - name: Install dependencies - run: npm install --frozen-lockfile - - name: Build website - run: npm run build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + submodules: recursive + fetch-depth: 0 + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: update content/publication + run: scripts/update_publication.sh + - name: Build with Hugo + env: + # For maximum backward compatibility with Hugo modules + HUGO_ENVIRONMENT: production + HUGO_ENV: production + run: | + hugo \ + --gc \ + --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./build # Build output to publish to the `gh-pages` branch + path: ./public + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2