Skip to content

governance: deploy builds once, rsyncs per surface#473

Merged
ChBrain merged 1 commit into
mainfrom
governance/deploy-build-once
Jul 4, 2026
Merged

governance: deploy builds once, rsyncs per surface#473
ChBrain merged 1 commit into
mainfrom
governance/deploy-build-once

Conversation

@ChBrain

@ChBrain ChBrain commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Every deploy-surface run built the entire site (prebuild download packaging + Astro build, plus the full baseline gates on production) and then rsynced a single surface folder out of it. So today's six-surface release ran six complete builds and six full test-suite runs of the identical commit, and every push to main has been building the site six times for staging.

Restructure — build once, deploy N:

  • deploy-surface.yml → three jobs: resolve (surface input → JSON list, new all option), build (one install/build — npm test gates on production, DEPLOY_ENV=staging build on staging — uploading dist/ as a 1-day artifact), deploy (per-surface matrix, fail-fast off: download artifact + the exact same target-resolution and two-rsync steps as before, unchanged byte-for-byte in their guards and --delete/no---delete semantics).
  • deploy-staging.yml → one call with surface: all instead of a six-call matrix. Per-surface independence is preserved inside the matrix legs — a single failed leg re-runs via "re-run failed jobs" without rebuilding, which is new (previously a re-run rebuilt).
  • deploy-production.yml — untouched; its single-surface call works as before, now shaped as one build + one rsync leg.
  • Manual dispatch defaults to surface=all, so a full release is one click instead of six.

Load-bearing detail: include-hidden-files: true on the artifact upload. dist/ carries .well-known/security.txt and the apex .htaccess; upload-artifact ≥4.4 strips hidden files by default, and losing them in the artifact hop would make the --delete rsync remove them from the live document roots.

Cost math: a six-surface release drops from 6×(install+build+full gates) to 1×; a staging deploy from 6 builds to 1. Bonus correctness: all surfaces in one deploy now ship from literally the same build, so a registry package publishing mid-release can no longer make surfaces diverge.

Verification: YAML parses; rsync/target logic is unchanged from the proven version. The workflow itself can only prove out on its first real run — the next merge to main exercises the staging path end-to-end. Suggest merging this when you can watch that run.

🤖 Generated with Claude Code

https://claude.ai/code/session_0176ZYTwoV8V4So9SBTizc5X


Generated by Claude Code

deploy-surface splits into resolve -> build -> matrix rsync legs and
gains surface=all; deploy-staging drops its six-call matrix for one
all-surfaces call. A six-surface release now costs one build (and one
baseline-gate run on production) instead of six. include-hidden-files
on the dist artifact is load-bearing: .well-known/ and .htaccess must
survive the artifact hop or the --delete rsync would remove them live.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0176ZYTwoV8V4So9SBTizc5X
@ChBrain
ChBrain merged commit 33c21de into main Jul 4, 2026
35 checks passed
@ChBrain
ChBrain deleted the governance/deploy-build-once branch July 4, 2026 21:27
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.

2 participants