Skip to content

Migrate to native GitHub Pages deployment (no gh-pages branch)#499

Merged
mmcky merged 2 commits intomainfrom
migrate-native-pages-deployment
Mar 26, 2026
Merged

Migrate to native GitHub Pages deployment (no gh-pages branch)#499
mmcky merged 2 commits intomainfrom
migrate-native-pages-deployment

Conversation

@mmcky
Copy link
Copy Markdown
Contributor

@mmcky mmcky commented Mar 25, 2026

Summary

Replaces the branch-based peaceiris/actions-gh-pages@v4 deployment with GitHub's native artifact-based Pages deployment (actions/deploy-pages@v4).

Changes

publish.yml:

  • Replace peaceiris/actions-gh-pages@v4 with actions/configure-pages@v5 + actions/upload-pages-artifact@v3 + actions/deploy-pages@v4
  • Add required permissions (pages: write, id-token: write, contents: write)
  • Add github-pages environment with deployment URL output
  • Add concurrency group to prevent deployment conflicts
  • Add CNAME step for custom domain (python-programming.quantecon.org)

linkcheck.yml:

  • Replace checkout ref: gh-pages with downloading the Pages artifact from the publish workflow
  • Extract and link-check against the artifact contents instead

Why

  • Eliminates gh-pages branch dependency — enables future branch deletion to reclaim ~300MB of repo space (153 commits of deploy snapshots since Oct 2020)
  • First-party GitHub support — uses GitHub's recommended deployment mechanism
  • No repo bloat — artifacts don't accumulate in git history
  • Built-in concurrency — prevents deployment race conditions

Post-merge steps

After merging and verifying a successful deploy:

  1. Change GitHub Pages source in repo Settings → Pages from "Deploy from a branch" to "GitHub Actions"
  2. Trigger a publish (tag) to verify deployment works
  3. Delete the gh-pages branch to reclaim space

See the companion issue for the full post-merge procedure.

Closes #419

- Replace peaceiris/actions-gh-pages@v4 with native actions/deploy-pages@v4
- Add required permissions (pages: write, id-token: write) and environment
- Add concurrency group to prevent deployment conflicts
- Update linkcheck.yml to download Pages artifact instead of checking out gh-pages
- Enables future deletion of gh-pages branch to reclaim ~300MB repo space

Closes #419
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the repository’s GitHub Pages deployment from a branch-based approach (gh-pages + peaceiris/actions-gh-pages) to GitHub’s native artifact-based Pages deployment, and updates link checking to run against the deployed Pages artifact instead of the gh-pages branch.

Changes:

  • Update Pages publishing workflow to use actions/configure-pages, actions/upload-pages-artifact, and actions/deploy-pages.
  • Add workflow-level Pages permissions, concurrency, and a CNAME file step for the custom domain.
  • Update linkcheck workflow to download and extract the Pages artifact and run link checking against it.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/publish.yml Switch deployment to artifact-based GitHub Pages and add Pages environment/concurrency/CNAME handling.
.github/workflows/linkcheck.yml Replace gh-pages checkout with downloading and extracting the Pages artifact for link checking.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

@github-actions github-actions bot temporarily deployed to pull request March 25, 2026 03:59 Inactive
…ts for linkcheck

- Add actions: read permission to publish.yml (needed by dawidd6/action-download-artifact)
- Switch linkcheck.yml from expiring Pages artifact to permanent release asset (tar.gz)
- Eliminates dependency on artifact retention window for link checking
@github-actions github-actions bot temporarily deployed to pull request March 25, 2026 04:18 Inactive
@mmcky mmcky merged commit ffa3c2c into main Mar 26, 2026
5 checks passed
@mmcky mmcky deleted the migrate-native-pages-deployment branch March 26, 2026 02:04
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.

Clean up gh-pages branch history (pre-2025)

2 participants