Skip to content

INFR: Migrate GitHub Pages deploy to artifact-based workflow - #331

Merged
mmcky merged 2 commits into
mainfrom
migrate-gh-pages-artifacts
Jul 8, 2026
Merged

mmcky merged 2 commits into
mainfrom
migrate-gh-pages-artifacts

Conversation

@mmcky

@mmcky mmcky commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What

Migrates GitHub Pages deployment from the legacy gh-pages branch method (peaceiris/actions-gh-pages) to native, artifact-based deployment, mirroring the family reference lecture-dp. See QuantEcon/meta#282 for the overall strategy.

Why

The gh-pages branch accumulates a full HTML snapshot on every publish, bloating the repo and slowing clones. Artifact-based deployment stores nothing in git — the deployed site lives in the Pages infrastructure — so the repo stays small and the gh-pages branch can be deleted.

Changes (single file: .github/workflows/publish.yml)

  • Add pages/id-token permissions and a pages concurrency group; run the publish job in the github-pages environment.
  • Replace peaceiris/actions-gh-pages@v4 with quantecon/actions/publish-gh-pages@v0.6.0 (handles the CNAME jax.quantecon.org and creates release assets).
  • Remove the manual HTML archive / checksum / manifest / action-gh-release steps — the action now produces those release assets (asset-name: lecture-jax-html).

Unchanged: the single-job GPU build (g4dn.2xlarge), the jax/CUDA install + GPU checks, LaTeX PDF, download-notebook build, and the sync to lecture-jax.notebooks. Per the migration guide, GPU repos keep a single job (rather than split build+deploy) to avoid transferring large build artifacts between runners.

Note on release-asset filenames

The manifest/checksum filenames change slightly (the action names them lecture-jax-html-checksum.txt / lecture-jax-html-manifest.json rather than html-checksum.txt / html-manifest.json); the HTML tarball name lecture-jax-html-<tag>.tar.gz is unchanged. Nothing in the repo depends on the old names (there is no linkcheck workflow here).

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."

  1. Merge this PR.
  2. Settings → Pages → Source → change to "GitHub Actions".
  3. Settings → Environments → github-pages → add a deployment rule of type Tag (not Branch) with the pattern publish*.
  4. Push a publish-* tag to trigger a deploy, then verify: the site loads at https://jax.quantecon.org/, and gh api repos/QuantEcon/lecture-jax/pages --jq '.build_type' returns workflow.
  5. Once the deploy is verified, delete the gh-pages branch: git push origin --delete gh-pages.

Rollback

If anything goes wrong before gh-pages is deleted: set Settings → Pages → Source back to "Deploy from a branch" → gh-pages, and the previous site serves again immediately.

🤖 Generated with Claude Code

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.

The GPU build stays a single job (per the migration guide, GPU repos avoid the
two-job build+deploy pattern to skip large artifact transfers). The manual HTML
archive / checksum / manifest / action-gh-release steps are removed — the
publish-gh-pages action now creates and uploads those release assets
(asset-name: lecture-jax-html). The jax/GPU install, LaTeX PDF, download
notebooks, and the lecture-jax.notebooks sync are unchanged.

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) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 7, 2026 06:02
@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploy Preview for incomparable-parfait-2417f8 ready!

Name Link
🔨 Latest commit 2eb23b6
🔍 Latest deploy log https://app.netlify.com/projects/incomparable-parfait-2417f8/deploys/6a4d74543ee1f10008f13917
😎 Deploy Preview https://deploy-preview-331--incomparable-parfait-2417f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the repository’s GitHub Pages publishing workflow from the legacy gh-pages branch deployment to an artifact-based Pages deployment, while preserving the existing single-job GPU build and notebook-sync steps.

Changes:

  • Adds explicit permissions, concurrency, and github-pages environment configuration for native Pages deployments.
  • Replaces peaceiris/actions-gh-pages (+ manual archive/release steps) with quantecon/actions/publish-gh-pages@v0.6.0 to deploy and optionally create release assets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish.yml
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 7, 2026 06:17 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request July 7, 2026 06:23 Inactive
The explicit permissions block set all unlisted scopes to none, so the
dawidd6/action-download-artifact step (which reads the build cache from
cache.yml via the Actions API) had no actions:read. Add it so the cache
download works reliably — important for this GPU build, where a cache miss
means rebuilding every jax notebook from scratch. Matches the permissions
example in QuantEcon/meta#282.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pull request July 7, 2026 22:09 Inactive
mmcky added a commit to QuantEcon/continuous_time_mcs that referenced this pull request Jul 8, 2026
The explicit permissions block set all unlisted scopes to none, so the
dawidd6/action-download-artifact step (which reads the build cache from
cache.yml via the Actions API) had no actions:read. The last publish still
succeeded, but the scope is the documented requirement and matches the
permissions example in QuantEcon/meta#282 — add it to guarantee the cache
download and keep this in sync with lecture-jax.

Ports the fix from QuantEcon/lecture-jax#331 (Copilot review follow-up).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pull request July 8, 2026 01:05 Inactive
@mmcky
mmcky merged commit 2bcae71 into main Jul 8, 2026
7 of 8 checks passed
@mmcky
mmcky deleted the migrate-gh-pages-artifacts branch July 8, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants