Repository navigation
INFR: Migrate GitHub Pages deploy to artifact-based workflow - #213
Merged
Merged
Conversation
Replace the peaceiris/actions-gh-pages deploy with native, artifact-based GitHub Pages deployment via quantecon/actions/publish-gh-pages, matching the family reference (lecture-dp). This removes the gh-pages branch dependency so the branch can be deleted, keeping the repo small. - publish.yml: add pages/id-token permissions and a "pages" concurrency group, run the publish job in the github-pages environment, and swap the deploy step for [email protected] (handles CNAME + release assets). The bespoke build (LaTeX PDF, download notebooks, notebook sync) is unchanged. - linkcheck.yml: stop checking out gh-pages; mirror the live site with wget (with a mirror-failed guard) so link checking no longer needs the branch. Requires a maintainer to switch Pages source to "GitHub Actions", add a publish* deployment tag rule to the github-pages environment, and delete gh-pages after a verified deploy. See QuantEcon/meta#282 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
✅ Deploy Preview for sparkly-moxie-de1f0e ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for adorable-cucurucho-69162b ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
12 tasks
There was a problem hiding this comment.
Pull request overview
Migrates GitHub Pages deployment from a gh-pages branch-based approach to GitHub’s native artifact/OIDC Pages deployment, and updates link checking to validate against the live published site instead of the removed branch.
Changes:
- Switch Pages publish workflow to OIDC/artifact-based deployment with appropriate
permissions,concurrency, andgithub-pagesenvironment. - Replace
peaceiris/actions-gh-pageswithquantecon/actions/publish-gh-pagesfor deployment (including CNAME + release assets). - Update link checking to mirror the live site via
wgetand gatelycheeexecution on a non-empty mirror.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/publish.yml |
Adds Pages/OIDC permissions + environment/concurrency and replaces branch-based deploy step with artifact-based Pages publish action. |
.github/workflows/linkcheck.yml |
Stops checking out gh-pages and instead mirrors the live site before running lychee, with a guard for empty mirrors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- publish.yml: "Build & Publish to GH-PAGES" -> "Build & Publish to GH Pages" (drops the gh-pages branch connotation now that deploys are artifact-based) - linkcheck.yml: "Link Checker [Anaconda, Linux]" -> "Link Checker" (the workflow uses no Anaconda) Both names now match the family reference (lecture-dp). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jul 7, 2026
Closed
mmcky
added a commit
that referenced
this pull request
Jul 7, 2026
* Fix linkcheck false positives introduced by the gh-pages migration The artifact migration (#213) switched linkcheck from checking out the gh-pages branch to a wget mirror of the live site. That mirror fetches only HTML (--accept html), so lychee reported every local asset (_static/*, _images/*) as "file not found"; the deploy also dropped 200 from --accept, so every working link (200) was flagged. Net result was issue #214: 522 "errors" that were essentially all false positives (0 real broken links, 0 timeouts). Switch to checking the published HTML release asset instead — a permanent tarball of the full site (HTML + assets), per QuantEcon/meta#282 lesson 2 and matching lecture-python-programming's linkcheck. Restore --accept 200,403,503 and add --root-dir so root-relative links (/_notebooks/*.ipynb, /_pdf/book.pdf) resolve against the site root. The release-asset input also removes the dependency on the live site being reachable at check time. See QuantEcon/meta#282 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * Check only top-level pages, skipping _static/ theme partials The recursive glob also scanned _site/_static/webpack-macros.html, a Sphinx theme partial containing raw Jinja (`{{ pathto(...) }}`) that lychee misread as ~15 broken local links. Restrict to top-level '_site/*.html' — matching the old checkout's '*.html' scope — so only real lecture pages are checked. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * Make release-asset fetch non-fatal (Copilot review) Under `set -eo pipefail`, a transient `gh api` failure aborted the fetch step before the empty-input guard ran, so no 'release asset missing' report was created. Add `|| true` (and silence stderr) so the guard still fires. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
This branch was previously deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrates GitHub Pages deployment from the legacy
gh-pagesbranch method (peaceiris/actions-gh-pages) to the native, artifact-based deployment used across the family. This mirrors the reference implementation in lecture-dp, which already runs on this pattern. See QuantEcon/meta#282 for the overall strategy and rationale.Why
The
gh-pagesbranch accumulates a full HTML snapshot on every publish, bloating the repo and slowing clones over time. Artifact-based deployment stores nothing in git — the deployed site lives in the Pages infrastructure — so the repo stays small and thegh-pagesbranch can be deleted entirely.Changes
.github/workflows/publish.ymlpages/id-tokenpermissions and apagesconcurrency group; run thepublishjob in thegithub-pagesenvironment; replace thepeaceiris/actions-gh-pages@v4step withquantecon/actions/[email protected](handles the CNAME and creates release assets). The bespoke build — LaTeX PDF, download-notebook build, and the sync tocontinuous_time_mcs.notebooks— is unchanged..github/workflows/linkcheck.ymlgh-pagesbranch. Mirror the live site withwget(with a guard that surfaces a failure instead of reporting green on an empty mirror), so link checking no longer depends on the branch.Required maintainer steps (settings — not in this PR)
The workflow change alone does not deploy. A repo admin must do the following, in order. Steps 2–3 must happen before the first tagged deploy or it will fail with "Tag is not allowed to deploy to github-pages due to environment protection rules."
publish*.publish-*tag to trigger a deploy, then verify: the site loads at https://continuous-time-mcs.quantecon.org/, andgh api repos/QuantEcon/continuous_time_mcs/pages --jq '.build_type'returnsworkflow.workflow_dispatch) and confirm it mirrors the live site correctly.Rollback
If anything goes wrong before
gh-pagesis deleted: set Settings → Pages → Source back to "Deploy from a branch" →gh-pages, and the previous site serves again immediately.🤖 Generated with Claude Code