Skip to content

ci(pages): wait for releases/latest before deploying on a release publish#187

Merged
stuffbucket merged 1 commit into
mainfrom
ci/deploy-pages-release-race
Jun 29, 2026
Merged

ci(pages): wait for releases/latest before deploying on a release publish#187
stuffbucket merged 1 commit into
mainfrom
ci/deploy-pages-release-race

Conversation

@stuffbucket

Copy link
Copy Markdown
Owner

Problem

The release: published event triggers the Pages deploy seconds before GitHub recomputes which release is "latest". The build resolves releases/latest, gets the previous tag, and ships stale version + download links.

Observed live on v0.4.36: the auto-deploy ran 6s after publish and shipped v0.4.35 (wordmark + .dmg/-setup.exe links all pointed at 0.4.35). A manual redeploy once the API had propagated fixed it.

The existing cache-busting in site/src/lib/version.ts (no-cache headers + per-build _cb query) defeats CDN staleness, but this is server-side propagation lag — a freshly-revalidated body still names the old release until GitHub finishes recomputing latest.

Fix

Add a gate step to deploy-pages.yml: when a release publish triggers the run, poll releases/latest (cache-busted, ~5 min budget) until it reports the just-published tag_name before building. If it never catches up, fail rather than ship a stale site — re-running the job once the API recovers is the recovery path.

Scoped to github.event_name == 'release' && release.prerelease == false:

  • The landing page tracks the latest stable release (resolveLatestReleasereleases/latest), which never reports a prerelease — so gating a beta publish on it would spin until timeout. Betas skip the gate.
  • push / workflow_dispatch runs have no specific tag to wait for and skip it too.

Validation

actionlint clean; YAML parses.

…lish

The release:published event fires the Pages deploy seconds before GitHub
recomputes which release is 'latest', so the build resolved the previous tag
and shipped stale version + download links (observed on v0.4.36: the auto-
deploy ran 6s after publish and shipped v0.4.35; a manual redeploy fixed it).

The cache-busting in site/src/lib/version.ts defeats CDN staleness but not
this server-side propagation lag. Gate the build on releases/latest reporting
the just-published tag (poll ~5 min, then fail rather than ship stale).

Only for non-prereleases: the landing page tracks the latest stable release,
which never reports a prerelease, so gating a beta publish on it would spin
until timeout. push / workflow_dispatch runs have no tag to wait for and skip
the gate.
@stuffbucket stuffbucket merged commit a4574f7 into main Jun 29, 2026
4 checks passed
@stuffbucket stuffbucket deleted the ci/deploy-pages-release-race branch June 29, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant