Repository navigation
ci(deploy-web): only the branch head deploys, and every build says which commit it is (#1051) - #1077
Merged
Merged
Conversation
…ich commit it is (#1051) deploy-web.yml runs check out their own event SHA and finish in any order, so an older push could take the dev alias after a newer one and roll dev back (2026-10-06: dev lost #1050's fix). Now: - A 'branch head' step compares the checked-out SHA with origin/<branch> just before eas deploy; an older run skips the deploy with a notice. - The build writes dist/client/build.json {commit, ref, target, builtAt}, served at /build.json. - A 'deployed build is this commit' step (not continue-on-error) polls /build.json until it serves this SHA, or the newer head, else fails. scripts/deploy-web-eas.sh (prod) gets the same stamp, refuses a dirty working tree (#1073: an uncommitted edit shipped that way) and a --skip-build whose dist was stamped from another commit, and checks the per-deploy EAS URL's /build.json after the upload. Closes #1051 Co-Authored-By: Claude Opus 5.5 <[email protected]>
thinkclay
added a commit
that referenced
this pull request
Oct 13, 2026
…lias six minutes (#1051) (#1078) The first real run of #1077's commit check (37813067368) failed while the deploy was correct: the dev alias took over two minutes to move to the new deployment, so /build.json kept 404ing from the previous one. dev served the new stamp shortly after. The check now reads /build.json from the per-deploy URL in the eas deploy output (the deployment itself, correct at once; the alias URL is excluded) and fails if that is wrong; then polls the alias for up to 6 minutes, reporting how long it took. The deploy step runs with shell: bash so the tee keeps pipefail. Co-authored-by: Claude Opus 5.5 <[email protected]>
thinkclay
added a commit
that referenced
this pull request
Oct 13, 2026
…loudFront, not a bare CNAME (#1051) (#1079) #1078's merge run (38410783002) deployed correctly — the per-deploy URL check passed for c37da27 — then failed the alias wait: dev.scaffald.com kept serving 5dfbe88's build.json for the whole 6 minutes. Not lag: dev.scaffald.com is behind CloudFront (x-cache: Hit from cloudfront, age 436) and EAS sends max-age=3600 for static files, so CloudFront held the old /build.json for an hour. scf-scaffald--dev.expo.app had the new one; dev.scaffald.com/build.json?x=… (a cache miss) did too. The query string is CloudFront's cache key, so both the CI check and the prod script now fetch /build.json?v=<sha>-<random>. #1077 dropped the cache-buster because local expo serve 404s static files with a query; the real hosts do not. The workflow comment claiming dev/preview CNAME straight to EAS is corrected. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Closes #1051.
The bug
deploy-web.ymlruns each check out their own event SHA and finish in whatever order they finish, so the last one to finish owns the alias. On 2026-10-06 an older push finished after a newer one and rolled dev back to before #1050's fix. Nothing noticed: the smoke test only checks for HTTP 200, and the entry hash doesn't change when only a route chunk does.Fix: both acceptance options, belt and braces
deploy-web.yml(dev and preview)eas deploy, the run compares its SHA withorigin/<branch>. A run that's no longer the head skips the deploy with a notice, and the summary says so.dist/client/build.jsonwith{commit, ref, target, builtAt}, served at/build.json.continue-on-error. It polls/build.jsonfor up to 2 minutes until it serves this SHA. If a newer head has already replaced it, that's fine and it says so. Anything else fails the run.scripts/deploy-web-eas.sh(prod and manual deploys)/build.jsonon the per-deploy EAS URL (CloudFront can't answer for that URL) and on the public URL.ALLOW_DIRTY=1overrides.--skip-buildwhendistwas stamped from another commit.Tested
sedextractionf80ec114d)/build.jsonfromdist/clientapplication/json(localexpo serve)--skip-buildwith dist stampedf80ec114d, HEADa2dce8a06One finding while testing: local
expo serve404s any static file with a query string (/robots.txt?cb=1), though EAS Hosting doesn't (dev.scaffald.com/robots.txt?cb=…is a 200). So the checks fetch/build.jsonwith no cache-buster.Not yet proven: the workflow steps themselves. That needs a real push to
main. After merge I'll check the run's head-guard and commit-check steps anddev.scaffald.com/build.json.🤖 Generated with Claude Code