PR previews on the modern GitHub Actions Pages source#47
Merged
Conversation
Rework PR previews to keep production on the modern "GitHub Actions" Pages source (actions/deploy-pages) instead of switching the Pages source to a gh-pages branch. No manual Settings -> Pages change is required. Because the Actions source serves a single whole-site artifact, previews are baked into that artifact rather than served as a separate deployment: - pr-preview.yml builds each PR with --baseurl /pr-preview/pr-<N> and uses rossjrw/pr-preview-action to stage the build on a dedicated pr-previews storage branch (never the Pages source, never served directly); the preview is removed and the sticky comment cleaned up when the PR closes. - jekyll.yml deploys via actions/configure-pages + upload-pages-artifact + deploy-pages. It always builds production from main, then an "Overlay PR previews" step folds the pr-previews branch's pr-preview/ tree into _site/pr-preview/ before upload. It runs on push to main and, via workflow_run, after each preview change, so previews ship in the live artifact at https://www.cmccoy.us/pr-preview/pr-<N>/ and survive production redeploys. A single 'pages' concurrency group serialises deploys. Update CLAUDE.md to document the artifact-overlay flow and its tradeoff. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DstwP2knezUiaBVqpBSZgR
cmccoy
pushed a commit
that referenced
this pull request
Jun 27, 2026
Remove the PR preview setup (PRs #46 and #47) and restore production deployment to its original form. - jekyll.yml: back to the plain push-to-main actions/deploy-pages workflow (no workflow_run trigger, no preview overlay). - Delete pr-preview.yml. - index.md: restore the original absolute /js/ script paths. - CLAUDE.md: restore the original Deployment section. Unrelated World Cup content updates are preserved. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DstwP2knezUiaBVqpBSZgR
claude Bot
added a commit
that referenced
this pull request
Jun 27, 2026
Remove the PR preview setup (PRs #46 and #47) and restore production deployment to its original form. - jekyll.yml: back to the plain push-to-main actions/deploy-pages workflow (no workflow_run trigger, no preview overlay). - Delete pr-preview.yml. - index.md: restore the original absolute /js/ script paths. - CLAUDE.md: restore the original Deployment section. Unrelated World Cup content updates are preserved. Claude-Session: https://claude.ai/code/session_01DstwP2knezUiaBVqpBSZgR Co-authored-by: Claude <noreply@anthropic.com>
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
Reworks the PR-preview setup so production stays on the modern "GitHub Actions" Pages source (
actions/deploy-pages) — no branch source, and no manual Settings → Pages change required. Reviewers still get an interactive, clickable preview of each PR athttps://www.cmccoy.us/pr-preview/pr-<N>/with a sticky comment linking to it.This supersedes the earlier gh-pages-branch approach (#46).
How it works
The Actions source serves one whole-site artifact (each deploy replaces the entire site), so previews are baked into that artifact rather than served as a separate deployment:
pr-preview.ymlbuilds each PR with--baseurl /pr-preview/pr-<N>and usesrossjrw/pr-preview-actionto stage the build on a dedicatedpr-previewsbranch underpr-preview/pr-<N>/. That branch is storage only — never the Pages source, never served directly. On PR close it removes the directory and the sticky comment.pr-preview.ymlfinishes it triggersjekyll.ymlviaworkflow_run. The deploy job always builds production frommain(so PR code never reaches production paths), then its Overlay PR previews step folds thepr-preview/tree from thepr-previewsbranch into_site/pr-preview/before uploading the artifact viaactions/upload-pages-artifact+actions/deploy-pages. Pushes tomainredeploy the same way, so open PRs' previews survive every production deploy.A single
pagesconcurrency group serialises deploys so none clobber each other.Tradeoff
Staying on the Actions source means every preview add/update/remove triggers a full production redeploy (cheap for this site), and a freshly pushed preview goes live a beat after its sticky comment posts (once the
workflow_rundeploy completes).Verified locally
/js/...); preview build emits/pr-preview/pr-1/js/....CNAMElands in_site/.cpnests correctly as_site/pr-preview/pr-<N>/.🤖 Generated with Claude Code
https://claude.ai/code/session_01DstwP2knezUiaBVqpBSZgR
Generated by Claude Code