Skip to content

chore(ci): build and validate the deploy site in one pass - #75

Merged
kieronlanning merged 1 commit into
mainfrom
chore/deploy-dedup
Nov 16, 2026
Merged

kieronlanning merged 1 commit into
mainfrom
chore/deploy-dedup

Conversation

@kieronlanning

Copy link
Copy Markdown
Contributor

Why

The deploy job did the same work three times for one artifact:

Step Measured
Run validation (just validate — which itself syncs live and builds) 410s
Refresh live release and documentation data (DATA_MODE=live bun run data:sync) 196s
Build site with live data (bun run build) 21s

The second and third steps re-created what the first had just produced, with nothing in between that could invalidate it.

just validate was also syncing twice internally: typecheck runs a data sync, and build depended on live-data-sync. A second live fetch bumps the release cache retrievedAt, which makes the docs mirror written moments earlier stale by definition (isMirrorManifestCurrent), so every documentation page was re-aggregated a second time as well.

What changed

  • deploy.yml resolves the Pages base and site URL before validation and puts them in that step environment, so the build just validate performs is the artifact that ships and the link, SEO and dist checks run against the URLs the deployment actually serves. The second build only ever existed to apply the base; the explicit live sync is gone with it.
  • just build depends on data-sync (cache-first) instead of live-data-sync, so the build inside just validate reuses the release data and docs mirror the earlier sync produced. A fresh checkout still fetches live (there is no cache), and just live-data-sync forces a refresh.
  • README and skills/site-validation-loop follow the recipes again.

Evidence

just validate locally end-to-end with a warm cache (the pre-push hook): 45s, reporting Releases: using existing cache. / Docs: using existing mirror., with the Astro build at 18s and 366 pages. The same chain previously synced and aggregated twice.

Expected CI effect: the deploy build job drops the duplicate sync and build (~217s of 667s) and just validate drops its second live sync and re-aggregation (~190s of 410s) — roughly 60% off the job.

No publishing behaviour changes: the data is still fetched live on every deploy, by just validate itself.

The deploy job ran `just validate` (which itself performs a live data sync and builds the site), then re-fetched every release and documentation record, then rebuilt the site just to apply the deployment base: three data syncs and two builds for one artifact, with nothing in between that could invalidate the first result. Measured on a successful run, that is 410s of validation + 196s of sync + 21s of build out of a 667s build job.

deploy.yml now resolves the Pages base and site URL *before* validation and puts them in that step environment, so the build `just validate` performs is the artifact that ships and the link, SEO and dist checks see the URLs the deployment actually serves. The explicit live sync and the second build are removed.

`just build` now depends on `data-sync` (cache-first) instead of `live-data-sync`, so the build inside `just validate` reuses the release data and the docs mirror the earlier `typecheck` sync already produced, instead of re-fetching and re-aggregating them. A fresh checkout still fetches live (there is no cache), and `just live-data-sync` forces a refresh.

README and the site-validation-loop skill follow the recipes again.
@kieronlanning
kieronlanning enabled auto-merge (squash) November 16, 2026 12:08
@kieronlanning
kieronlanning merged commit 7275ebd into main Nov 16, 2026
1 check passed
@kieronlanning
kieronlanning deleted the chore/deploy-dedup branch November 16, 2026 12:13
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