Branch-to-Environment Map
| Branch or event | What deploys | Follow-up automation |
|---|---|---|
| Feature branch push | CI only; Vercel preview deployments require trusted manual dispatch from main with preview_ref | None by default |
main push | Platform Vercel preview build validation | supabase-staging.yaml can apply staging migrations after the preview build succeeds |
production push | Platform Vercel production build validation | supabase-production.yaml can apply production migrations after prerequisites pass |
main push for apps/discord | Discord Modal deployment after Python CI succeeds | None |
Manual workflow_dispatch | Depends on workflow | Bypasses normal branch trigger timing, but not the workflow logic; production Supabase migration dispatches must select production |
Self-hosted server after git pull | Docker deploy from current checkout | Optional blue/green cutover through bun serve:web:docker:bg |
Hosted Web Release Flow
Preview
- Preview workflows are named
vercel-preview-<app>.yaml. - Most preview workflows are manual-only from
mainwith a requiredpreview_ref;vercel-preview-platform.yamlalso triggers on protectedmainpushes so the staging database workflow receives a same-SHA platform build signal. e2e-tests.yamlalso runs only on non-productionpushes; production promotion relies on the already-green validation before the branch is promoted plus the production build-validation gates below.- Each workflow checks whether a newer commit exists on the same branch before spending time on install/build/deploy.
- Each deploy job is bound to a
vercel-preview-<app>GitHub Environment and introduces Vercel credentials only after dependency installation. - Platform preview is build validation only; on-premise machines own the actual
apps/webruntime deployment. - Satellite preview deploys remain the normal Vercel validation surface for
branch work and merged
mainchanges. - Platform preview and production build validation workflows cross-credit successful same-SHA build markers. If one has already passed for a commit, the other can record success without reinstalling dependencies or rebuilding.
Staging Database
supabase-staging.yamlis tied to theVercel Platform Preview Deploymentworkflow onmain.- The staging migration runs only when the triggering platform preview build concludes successfully, or when manually dispatched.
- The staging deploy step runs
supabase db push --include-allafter linking the staging Supabase project, so staging can converge aftermainmigration history changes. - This means
mainis where app preview and staging schema advancement are meant to stay aligned. - If a production commit was promoted before the same-SHA staging migration run
existed, manually dispatch
supabase-staging.yamlfrommain; production migration re-evaluates after that staging run succeeds.
Production
- Satellite production web deploys run through
vercel-production-<app>.yaml. apps/webproduction build validation is handled byvercel-production-platform.yaml; on-premise machines handle the actual runtime deployment.apps/appsproduction deploys are handled byvercel-production-apps.yaml.apps/qrproduction deploys are handled byvercel-production-qr.yaml.- The production workflow also skips if a newer commit already exists on
production. - Production deploy jobs are bound to
vercel-production-<app>GitHub Environments and reject manual dispatches unless the selected branch isproduction.
Browser App Version Metadata
- Browser apps share one platform version from
packages/utils/src/platform-release.ts; do not read visible app versions from individual apppackage.jsonfiles. - The current shared browser app version is
0.1.32. - Every Vercel browser app workflow runs
bun run --silent scripts/ci/generate-build-metadata.tsbeforevercel build. The generated metadata includes the commit hash, short hash, commit message, ref, environment, deployment URL, deployment stamp, and build timestamp. - The account-scoped version badge uses
public.user_configskeySHOW_VERSION_BADGE. It is hidden by default and only exact@tuturuuu.comaccounts may enable a truthy value. - Exact-domain enforcement happens on the server through
isExactTuturuuuDotComEmail; subdomains such as@xwf.tuturuuu.comare not eligible, and client cookies cannot make the badge render for ineligible users.
Production Database
supabase-production.yaml is stricter than staging:
- It re-evaluates automatically after either
Vercel Platform Production Deploymentcompletes its build validation onproductionorSupabase Staging Migrationcompletes onmain. - The production platform build validation for the target commit must have
concluded successfully on
production. - The
mainstaging migration for the same target commit must have completed with asuccessconclusion. - A manual dispatch can still be used when an operator explicitly wants to run
it, but the dispatch must select the
productionbranch and still satisfy the same production-deployment and staging-migration SHA checks.
supabase db push --include-all. This keeps production schema changes
behind application build validation, staging validation, and branch promotion
for the same commit.
Self-Hosted Web Release Flow
If a server receives code throughgit pull, use the Docker production commands from
the checked-out commit:
bun serve:web:dockerfor in-place replacementbun serve:web:docker:bgfor blue/green rebuild-before-cutover deployment
Team Release Checklist
- Merge the change set with green CI.
- If Docker behavior changed, make sure
docker-setup-check.yamlis green. - If database migrations changed, confirm the
main-driven staging path first. - Promote to
productiononly after preview and staging behavior is understood. - Confirm the follow-up Supabase workflow after production build validation.
- For self-hosted rollout, deploy from the intended commit and prefer
bun serve:web:docker:bg.
Rollback Guidance
- Vercel-hosted rollback: for satellite apps, redeploy the previous known-good commit or use Vercel rollback tooling.
- Supabase rollback: use a corrective migration instead of editing applied migration history.
- Self-hosted Docker rollback: checkout the previous known-good commit and rerun
bun serve:web:docker:bg.
What Not To Do
- Do not push production schema changes directly from a laptop as the normal path.
- Do not assume staging and production migrations are interchangeable; they are gated differently.
- Do not manually dispatch production Supabase migration from
main; the only validmainpath is the automatic staging-migration re-evaluation, and the production gate still requires the same commit to have both a successful production platform build and a completed successfulmainstaging migration. - Do not use the in-place Docker path when you specifically need rebuild-before-restart semantics.