Deploy to GitHub Pages #16
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
| name: Deploy to GitHub Pages | |
| # NOTE: the repo's Pages source must be set to "GitHub Actions" (build_type=workflow), | |
| # NOT the legacy branch source. With the branch source this workflow runs, reports | |
| # success, and deploys nothing — the same trap db-viz-station hit. | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| sha: | |
| description: "Commit to deploy (default: head of the dispatched ref)" | |
| required: false | |
| type: string | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Deploy an EXPLICIT commit when one is given, not whatever `main` resolves | |
| # to now. refresh.yml pushes and then immediately dispatches this workflow, | |
| # and GitHub's resolution of `--ref main` is not guaranteed to have caught | |
| # up with that push: run 31184322676 pushed 2dccd93 and the pages run it | |
| # dispatched 81s later checked out 3baec71, its own PRE-push SHA. It then | |
| # uploaded the stale tree and reported success, so the site got a fresh | |
| # Last-Modified wrapping old bytes and nothing anywhere went red. | |
| # | |
| # It is a race, not a deterministic failure — the 04:34 run the same day | |
| # resolved correctly — which is worse: it goes green either way, and the | |
| # only symptom is data that silently stops updating. | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.sha || github.sha }} | |
| - uses: actions/configure-pages@v5 | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./public | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |