Migrate GH Pages deploy to artifact-based deployment#783
Conversation
Replace peaceiris/actions-gh-pages with native GitHub Pages deployment (configure-pages / upload-pages-artifact / deploy-pages) and update the linkcheck workflow to download the release HTML archive instead of checking out the gh-pages branch. - publish.yml: add permissions (contents/actions/statuses/pages/id-token), concurrency group, and the github-pages environment; write CNAME into the build output; keep Netlify, release-asset upload, and notebook sync untouched - linkcheck.yml: download the latest release .tar.gz and run the QuantEcon AI link-checker instead of lychee against a gh-pages checkout Part of QuantEcon/meta#282 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for taupe-gaufre-c4e660 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Migrates GitHub Pages publishing from a gh-pages branch deployment to the native artifact-based Pages deployment flow, and updates link checking to operate on the latest release HTML archive (rather than checking out gh-pages) as part of the planned branch deletion/size reduction.
Changes:
- Update
publish.ymlto deploy viaactions/configure-pages+actions/upload-pages-artifact+actions/deploy-pages, including explicit workflow permissions and a Pages concurrency group. - Update
linkcheck.ymlto download and extract the latest release.tar.gzHTML archive and runQuantEcon/action-link-checker.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/publish.yml | Switches Pages deployment from peaceiris/actions-gh-pages to artifact-based Pages deployment with explicit permissions/concurrency. |
| .github/workflows/linkcheck.yml | Replaces gh-pages checkout + lychee with “download latest release HTML” + QuantEcon link checker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- add contents:read so the gh api releases call works under a restrictive permissions block - set -euo pipefail; select a single .tar.gz asset and fail with a clear error when none is found - curl -fsSL so an HTTP error page fails the step instead of being piped into tar Keeps QuantEcon/action-link-checker@main (first-party org action; matches the reference in lecture-python-programming). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Addressed Copilot's 4 comments in 51c25b5:
The three hardening changes were filed for the identical workflow in |
Summary
Migrates GitHub Pages deployment from the
gh-pagesbranch (peaceiris/actions-gh-pages) to native artifact-based deployment, following the QuantEcon infrastructure guide in QuantEcon/meta#282.lecture-python-programmingwas migrated the same way in QuantEcon/lecture-python-programming#499. Once thegh-pagesbranch is deleted (final step, after verification), the repo drops from ~767 MB to ~15 MB.This PR only touches the two workflow files. Merging it changes nothing on the live site — the site keeps serving from
gh-pagesuntil we flip the Pages source in repo Settings (a manual post-merge step). So there is no downtime window from merging.What changed
publish.ymlpermissionsblock, apagesconcurrency group, and thegithub-pagesenvironment on the job.peaceiris/actions-gh-pages@v4step withconfigure-pages@v6+upload-pages-artifact@v5+deploy-pages@v5, writingintro.quantecon.orginto_build/html/CNAMEfirst._buildcache upload, and notebook sync are all left untouched.linkcheck.ymlgh-pagescheckout (which won't exist after migration) with a download of the latest release.tar.gz, and swaps lychee forQuantEcon/action-link-checker@main— matching the standard now used bylecture-python-programming.Note on the
permissionsblockThe workflow previously ran with the default permissive token. Because specifying
permissions:resets every unlisted scope tonone, the block enumerates everything this workflow actually needs. Two entries are specific to this repo (the programming reference did not need them):contents: writesoftprops/action-gh-release) and Netlify commit commentactions: readdawidd6/action-download-artifactpulls thebuild-cacheartifact fromcache.ymlstatuses: writepages: writeactions/deploy-pagesid-token: writeactions/deploy-pagesPost-merge steps (manual — do NOT skip the order)
Per QuantEcon/meta#282 §7.2, after this merges:
github-pages→ add a Tag deployment rulepublish*(without this the first tag deploy fails with "Tag is not allowed to deploy… due to environment protection rules").publish-*tag and watch the run.build_type: workflow, release assets attached, notebook sync ran, Netlify deployed.workflow_dispatchand confirm it downloads the release asset.gh-pagesbranch and notify the team to prune locally.Rollback
If anything looks wrong before step 6: Settings → Pages → Source → "Deploy from a branch" →
gh-pages, and the site immediately serves from the old branch again.🤖 Generated with Claude Code