Add interactive PR previews via gh-pages branch#46
Merged
Conversation
Set up infrastructure so reviewers can click through a live preview of any PR that changes the site. - Move production deploy off the "GitHub Actions" Pages source and onto the gh-pages branch (JamesIves/github-pages-deploy-action). This is required so PR previews can share a hosting mechanism with production — a repo has only one Pages source. - Add pr-preview.yml: builds each PR with --baseurl /pr-preview/pr-<N> and deploys an interactive preview to www.cmccoy.us/pr-preview/pr-<N>/ via rossjrw/pr-preview-action, with a sticky PR comment. Production deploys preserve previews (clean-exclude: pr-preview/); previews are removed when the PR closes. - Fix two hardcoded absolute /js/ script paths in index.md to use relative_url so they resolve correctly under a preview subpath. - Document the new deploy flow, the one-time Pages-source setting, and the static-JS absolute-asset-path caveat in CLAUDE.md. 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
Sets up infrastructure so reviewers can click through a live, interactive preview of any PR that changes the site, at
https://www.cmccoy.us/pr-preview/pr-<N>/, with a sticky comment on the PR linking to it. The preview is removed automatically when the PR closes.Why this shape
Interactive previews on GitHub Pages require the Pages source to be a branch — a repo has exactly one Pages source, so previews and production must share a hosting mechanism. This moves production off the "GitHub Actions" Pages source and onto a
gh-pagesbranch, then deploys previews into apr-preview/subdirectory of that same branch. Fully self-hosted — no external services, accounts, or secrets, in keeping with the repo's minimal/self-contained philosophy.Changes
.github/workflows/jekyll.yml— production now builds onmainand publishes_site/to thegh-pagesbranch viaJamesIves/github-pages-deploy-action, preserving PR previews withclean-exclude: pr-preview/.CNAMEis carried into the published output, so the custom domain is preserved..github/workflows/pr-preview.yml(new) — builds each PR with--baseurl /pr-preview/pr-<N>and deploys viarossjrw/pr-preview-action.index.md— fixed two hardcoded absolute/js/script paths to userelative_urlso they resolve under the preview subpath. (Verified locally: prod build keeps/js/..., preview build emits/pr-preview/pr-1/js/....)CLAUDE.md— documents the new deploy flow, the one-time Pages setting, and a known caveat about absolute asset paths inside static JS.After merge, change Settings → Pages → Build and deployment → Source to "Deploy from a branch" →
gh-pages/(root). Until then, production keeps serving the last "GitHub Actions" deploy (it won't break, just won't update) and preview URLs will 404. Merging this triggers the production workflow, which creates thegh-pagesbranch so the setting is ready to flip.🤖 Generated with Claude Code
https://claude.ai/code/session_01DstwP2knezUiaBVqpBSZgR
Generated by Claude Code