Add GitHub Pages PR previews (migrate main deploy to gh-pages branch)#3
Merged
Conversation
Rework main deploy to publish built _site to the gh-pages branch root (keep_files preserves preview subdirs), and add a PR Preview workflow that publishes each PR to /labs/pr-preview/pr-N/ and comments the URL. Lets stakeholders without repo access review branches via a plain URL
Contributor
|
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
pages.yml) to publish the built_siteto the root of agh-pagesbranch (keep_files: trueso it never wipes preview subdirs).pr-preview.yml: every PR builds and publishes to/labs/pr-preview/pr-N/, auto-comments the preview URL, and tears the preview down on close/merge.Why
Lets stakeholders without repo access review branch content (copy, style) via a plain public URL — no clone, no GitHub account needed (repo is public).
Cutover (zero downtime)
pages.ymlruns and seedsgh-pagesroot with the full live site.gh-pagesbranch:gh-pagesalready holds the complete site. The public URL (workato-devs.github.io/labs/) is unchanged.Rollback: flip the source back with
"build_type":"workflow".Note: opening this PR triggers
pr-preview.ymlfor the first time (createsgh-pages+ a preview of this PR). The preview URL only resolves after the source flip above.🤖 Generated with Claude Code