Deployments
Pull requests run CI. A successful CI run on main deploys that exact commit to Preview. For Production, manually dispatch the deploy workflow with production. The workflow applies D1 migrations first, then deploys the Preview large-archive scanner, pipeline, API, web, admin, and docs. The large-archive consumer and regular scanner use the same source commit so their rules and scanner fingerprints stay aligned. The large-archive consumer is deployed only when the target is preview.
Manual deployment
Section titled “Manual deployment”These commands mirror the Preview workflow. The web and admin builds select their target through CLOUDFLARE_ENV. Wrangler deploys those apps using the generated configuration.
pnpm install --frozen-lockfileCLOUDFLARE_ENV=preview pnpm buildpnpm --filter @dshu/api exec wrangler d1 migrations apply DB --remote --env previewpnpm --filter @dshu/api exec wrangler d1 execute DB --remote --env preview --command 'PRAGMA optimize'pnpm --filter @dshu/pipeline exec wrangler deploy --config wrangler.large-preview.jsoncpnpm --filter @dshu/pipeline exec wrangler deploy --env previewpnpm --filter @dshu/api exec wrangler deploy --env previewpnpm --filter @dshu/web exec wrangler deploypnpm --filter @dshu/admin exec wrangler deploypnpm --filter @dshu/docs exec wrangler deploy --env previewTemporary D1 overload
Section titled “Temporary D1 overload”A migration failure stops the release immediately. The subsequent PRAGMA optimize statistics maintenance runs separately. Only D1 overload error 7429 is retried, for at most four attempts with approximately 5, 10, and 20 seconds of exponential backoff plus jitter. Authentication, syntax, process errors, and exhausted retries still stop the release. Maintenance retries do not repeat migrations or bypass statistics maintenance.
Rollback
Section titled “Rollback”Identify the affected Worker and a compatible earlier version in Cloudflare. For Preview web, run pnpm --filter @dshu/web exec wrangler rollback "$VERSION_ID" --name dshu-preview-web. Confirm the active version and repeat the release checks. Handle D1 migrations and KV data through their own recovery procedures. See Cloudflare versions and deployments.
Post-deployment checks
Section titled “Post-deployment checks”- Confirm the commit and deployed Worker versions.
- Check API
/healthz, both index schemas, and ETag revalidation. - Check the catalog home and a plugin page, robots.txt, sitemap, and llms.txt. Verify documentation pages and their Markdown in both languages.
- Check noindex on Preview web and docs, Worker errors, and the scan queue. Check signed-in admin operations once Preview authentication is configured.
See database migrations and incident runbooks.