Deploy: stage static sync (assets→shell→SW) to avoid deploy-race blank screens

Per Codex. Shared deploy/sync-static.sh used by both publish scripts: sync new
hashed chunks first WITHOUT pruning old ones (grace window so in-flight/old
clients keep chunks they still need), then other assets, then index.html, then
service-worker.js last — so a new shell never appears before its chunks exist.
Old immutable chunks pruned after 14 days to bound disk growth.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
jay
2026-06-11 12:03:55 -04:00
parent c7e00e7fdc
commit 254db67055
3 changed files with 24 additions and 4 deletions
+2 -2
View File
@@ -10,8 +10,8 @@ api_compose="/home/jay/srv/upbeatbytes/compose.yaml"
echo "→ building frontend"
( cd "$repo/frontend" && npm run build )
echo "→ syncing static site to $site"
rsync -a --delete "$repo/frontend/build/" "$site/"
echo "→ syncing static site to $site (assets first, shell + SW last)"
bash "$repo/deploy/sync-static.sh" "$repo/frontend/build" "$site"
echo "→ rebuilding/refreshing API container"
docker compose -f "$api_compose" up -d --build