Files
evig/.github/workflows
CatoandClaude Opus 5 1a5bf15cc8 ci(deploy): require CI's green instead of rebuilding it; stop cancelling deploys (#465)
Measured on 2026-09-07, this repo built the SAME commit four times per merge:

  1. CI  -> Code Quality -> `verify`            9.6m step (verify includes build)
  2. CI  -> Local E2E Journeys -> "Build app"   4.0m
  3. Deploy -> `pnpm run verify`                concurrent with (1), same SHA
  4. Deploy -> selfhost-deploy-evig.sh          the build that actually ships

Only (4) produces the artifact. (3) is deleted here and replaced by a gate that
REQUIRES CI Pipeline to be green on this commit.

That is not a weaker gate. The old step's comment was right that an earlier
version had been weaker — but because it re-inlined a SUBSET (no lint:chrome,
i18n only), not because it ran a second copy. Depending on the full bundle
passing once gives identical coverage without building the commit again.

The gate has three outcomes: green -> deploy; red -> fail loudly; superseded
(main moved past this commit) -> skip, because the newer commit's deploy ships
this change too. It fails closed on timeout.

Second change, and the one worth having on its own: cancel-in-progress: false.
Of this repo's last 10 deploys, 4 were CANCELLED — 40%, against 0% for all
seven other repos measured. This repo is the only one that sets cancel-on-push,
and it also has the fleet's longest deploy, so any merge inside a ~13-minute
window kills the running one. Three cancelled each other in a row this
afternoon and a merged fix needed three attempts to reach production.
Cancelling is only safe if the newer run is guaranteed to finish. Queuing plus
the supersede check gives the intended behaviour with no lost deploys.

`Mark deployed` now carries the gate too — it is what starts the prod smoke
job, and a superseded run deployed nothing. Smoke-testing a release this run
never made reports the failure against THIS commit, blaming a change that
never shipped.

Third: CI now caches .next/cache for both of its builds. The deploy workflow
already did; CI never has, which is why CI was the slower of the two. Keys are
per-job so the two builds do not evict each other, with shared restore-keys.


Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 06:27:17 -07:00
..