Add per-PR preview deployment workflow#3348
Merged
Merged
Conversation
Deploys the demo for each pull request to gh-pages/pr-preview/pr-N/ via rossjrw/pr-preview-action. The action comments the preview URL on the PR, redeploys on push, and removes the directory on close. Adds CLEAN_EXCLUDE to the existing master deploy so that master deploys do not wipe out per-PR preview directories on gh-pages. Fork PRs are skipped because GITHUB_TOKEN is read-only in that context and cannot push to gh-pages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
BryanValverdeU
approved these changes
May 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a per–pull request GitHub Pages preview deployment so each PR can publish a demo build under a stable URL on the gh-pages branch without being wiped by the main deploy workflow.
Changes:
- Introduces
pr-preview.ymlto build and deploy PR previews togh-pages/pr-preview/pr-<n>/and clean them up on PR close/merge. - Updates the existing
build-and-deploy.ymlto excludepr-preview/**from the branch-clean step so PR previews persist acrossmasterdeploys.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/pr-preview.yml |
New PR-triggered workflow to build and deploy per-PR preview sites to gh-pages. |
.github/workflows/build-and-deploy.yml |
Prevents the main deploy job from deleting PR preview directories on gh-pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review feedback: the action runs with contents: write and pull-requests: write, so pin to the v1.8.1 commit SHA instead of the moving v1 tag to prevent upstream tag re-pointing from silently altering what executes with that access. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BryanValverdeU
approved these changes
May 21, 2026
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.
Summary
pr-preview.ymldeploys each PR's demo site togh-pages/pr-preview/pr-<n>/usingrossjrw/pr-preview-action. The action comments the preview URL on the PR, redeploys on push, and removes the directory when the PR is closed or merged.build-and-deploy.ymlwithCLEAN_EXCLUDE: '["pr-preview/**"]'so master deploys no longer wipe per-PR preview directories from thegh-pagesbranch.if:guard) becauseGITHUB_TOKENis read-only in that context and cannot push togh-pages. Fork support can be added later via aworkflow_run-based design.Test plan
pr-preview/pr-<n>/is removed fromgh-pagesand the comment is updated.🤖 Generated with Claude Code