Repository navigation
ci: label-gated PR preview deploys to Cloud Run - #7
Open
chasetmartin wants to merge 4 commits into
Open
chasetmartin wants to merge 4 commits into
chasetmartin wants to merge 4 commits into
Conversation
Each PR builds its merge result into its own Cloud Run service (newweaver-pr-<number>) and keeps a single PR comment updated with the URL. Closing the PR deletes the service and its images. Reuses the Workload Identity Federation setup from deploy.yml; fork PRs are skipped since they get no OIDC token. Builds use the GHA layer cache so repeat pushes skip the pnpm install. PostHog is left unconfigured so previews don't send events to production analytics. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Previews now deploy only while the PR carries the "preview" label: adding it deploys immediately, pushes redeploy while it is on, and removing it (or closing the PR) tears the preview down. Other label changes are ignored. Concurrency moves from the workflow to the deploy/teardown jobs so runs triggered by unrelated label events, whose jobs all skip, can't cancel an in-flight deploy.
Teardown now deletes only the Cloud Run service. Images stay in Artifact Registry, so the deploy service account doesn't need delete rights on the repository.
|
Preview: https://newweaver-pr-7-auejgdbofq-uc.a.run.app Built from the merge of c735fd8 into |
chasetmartin
requested review from
jirhiker
and
a balanced review from Copilot
and removed request for
Copilot
October 1, 2026 18:04
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
Adds
.github/workflows/preview.yml, which deploys a per-PR preview of the SPA to Cloud Run. Previews are opt-in with apreviewlabel.preview: builds the PR's merge commit into its own service (newweaver-pr-<number>) and posts the URL in a single PR comment, which is updated on each deploy.It reuses the Workload Identity Federation setup and repo variables from
deploy.yml. PostHog is left unconfigured, so previews don't send events to production analytics.Replaces #6.
Test plan
previewto this PR. The service deploys and the comment shows a working URL.preview. The service is deleted.