ci(sandbox): production release from CI; the image push logs itself in
What
- Production release job. The Sandbox workflow's dispatch input becomes a choice.
real-sandboxis the old behaviour.production-releaserunsbun run release --productionon a runner, frommainonly, one at a time: it builds and pushes the image, rebuilds the internal golden, probes a fork and repoints production's environment rows. - The image push logs itself in.
bun run imagemints a registry credential fromVERCEL_SANDBOX_TOKENand pipes it todocker login. This is the same exchangevercel vcr loginmakes. The CLI can't do it in CI because it looks up a user, and the project token has none. The build then pushes with the same buildx output the CLI used (zstd, OCI media types).
Why
The release needs Docker, the registry, Neon and the sandbox secrets. On a laptop that meant a 12-hour registry login and an arm64 machine emulating amd64. On a runner every input comes from repo secrets and the build is native.
Verified
- The project token mints the credential (200). The credential's claims name team
superset-shand projectsandboxes. SANDBOX_IMAGE_TAG=push-check bun run imagebuilt and pushed through the new login from a laptop. The tag showed up in the registry and was then deleted.latestwas not touched.- The
production-releasejob itself can only run frommain, so its first run is after the merge. Every step before the image push is harmless if it fails: the bundle upload is content-addressed and rows are written last.
https://claude.ai/code/session_01FK6rLzBEUiHHXZWNmpQ2BP
Summary by cubic
Moves the Sandbox production release off laptops and into CI. The workflow's dispatch input is now a choice; production-release (main only, one at a time) runs bun run release --production on a runner with all secrets from the repo. Image pushes log Docker into Vercel Container Registry themselves with a credential minted from VERCEL_SANDBOX_TOKEN, replacing the 12-hour vercel vcr login docker session (the CLI needs a user account, which the project token does not have).
Verified
SANDBOX_IMAGE_TAG=push-check bun run imagebuilt and pushed through the new login from a laptop; the tag was deleted andlatestuntouched.- The token mints the credential (200) with claims naming team
superset-shand projectsandboxes. - Dispatch
production-releaseafter a merge tomain; every step before the image push is harmless if it fails, and environment rows are written last.