multi-site-deploy-optimization
Multi-site deploy optimization
One example fleet runs 29 deployable sites from one codebase — 31 folders
under sites/ minus the _starter and _shared dirs (ls sites in the repo).
Each site is its own Cloudflare Worker with its own D1 and KV. Site config,
theme and brand are baked in at build time by site:use.
The problem
A change to shared code (apps/, packages/, workers/) deployed all 29
sites. Each site ran a full OpenNext build of identical code, then D1
migrations, then 4 worker deploys — on main (staging) and again on release
(production). One full release deploy took about 40 minutes — one measured run
(one Actions run on 2026-10-23, 15:39 to 16:19 UTC), not an average.
What landed, in order
Work through the fixes in this order: ignore list, canary-only staging, side workers, migrations, then build once.