Six Workers, each with a staging and a production environment in its wrangler.jsonc. The top level of every config is the local dev and e2e setup and is never deployed. The full checklist, with resources, bindings and secrets, is in docs/DEPLOY.md.
Environments
| Worker | Staging | Production |
|---|---|---|
| realtime | malla-realtime-staging | malla-realtime |
| api | malla-api-staging | malla-api |
| sites | malla-sites-staging | malla-sites |
| web | malla-web-staging | malla-web |
| runner | malla-runner-staging | malla-runner |
| mcp | malla-mcp-staging | malla-mcp |
Neon branches map to environments: dev backs staging, main backs production. Service bindings always point at the same environment.
Release
Secrets
Set each Worker’s secrets with
wrangler secret put --env <env>. Shared values (internal key, realtime token secret) must match across Workers. Secrets are never set by scripts.Migrations
Apply
packages/db/migrationsin order to the environment’s Neon branch before deploying an api that needs them. Migrations are forward-only.bashread -rs DATABASE_URL && export DATABASE_URL # the branch's connection string pnpm --filter @malla/db db:migrate unset DATABASE_URLDeploy
The script builds the workspace packages and the Nuxt app, then deploys in dependency order, so each service binding’s target exists first.
bashpnpm deploy:check # build and validate every Worker, upload nothing pnpm deploy:staging # sh scripts/deploy.sh staging pnpm deploy:production # sh scripts/deploy.sh productionDeploy order realtimerunnerapimcpsiteswebSmoke check
Load the app, sign in, open a site (the realtime socket connects), upload an image, publish to staging, submit a form, and watch the api cron with
wrangler tail.
Rollback
- A site: publishes are immutable, so rolling back is a pointer flip to an earlier
publishId. No redeploy. Use Recent publishes in the editor's publish popover, orPOST /sites/:siteId/rollback; see Roll back. - A Worker: roll back with Wrangler, in reverse deploy order when a change spans Workers. Secrets and bindings are not versioned with code.
- The database: branch or snapshot
mainin Neon before a risky migration; restore it to undo. - Durable Object migrations cannot be rolled back; never revert a release past one.
(cd apps/<app> && npx wrangler rollback --env <env>)
npx wrangler versions list --env <env>