Repository navigation
Update github actions (major) #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Build + deploy the Hugo site to GitHub Pages on every push to main. | |
| # Adapted from the official Hugo template at | |
| # https://gohugo.io/host-and-deploy/host-on-github-pages/. | |
| name: Deploy Hugo site to Pages | |
| on: | |
| push: | |
| branches: [main] | |
| # Build on every pull request too, so a change to the layout, the content or | |
| # the Hugo version has to prove the site still builds before it lands. | |
| # Without this the workflow ran only on main, which meant a dependency bump | |
| # arrived with no signal at all -- its checks read "no checks", which is not | |
| # the same thing as green and must not be merged as if it were. | |
| pull_request: | |
| workflow_dispatch: | |
| # Allow only one concurrent deployment, skipping runs queued between | |
| # the run in-progress and latest queued. Don't cancel in-progress | |
| # runs — we want them to finish before a new build replaces them. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| env: | |
| # Pin Hugo so site builds don't break when a new release ships | |
| # incompatible template changes. Bump deliberately, not by | |
| # surprise. | |
| HUGO_VERSION: 0.135.0 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Hugo CLI | |
| run: | | |
| wget -O hugo.deb "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb" | |
| sudo dpkg -i hugo.deb | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v6 | |
| - name: Build | |
| env: | |
| HUGO_ENVIRONMENT: production | |
| HUGO_ENV: production | |
| run: | | |
| hugo \ | |
| --gc \ | |
| --minify \ | |
| --baseURL "${{ steps.pages.outputs.base_url }}/" | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: ./public | |
| deploy: | |
| # Only main publishes. A pull request stops after build above: it has built | |
| # the site and uploaded the artifact, which is the whole point of the gate, | |
| # and it has no business replacing what is served. | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| 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@v5 |