Skip to content

Deploy Guide ​

Deploy to Zeabur ​

  1. Push your repo to GitHub
  2. Go to zeabur.com → New Project → Add Service → GitHub
  3. Select your repo — Zeabur auto-detects Next.js via zbpack.json
  4. Set env vars (see Deployment docs)
  5. Deploy

Required Env Vars ​

env
DATABASE_URL=postgresql://...
AUTH_SECRET=<random 32+ char secret>
NEXTAUTH_URL=https://your-app.zeabur.app

Zero-Downtime Deploys ​

Migrations do not run at startup (start is plain next start, and the standalone runtime image has no drizzle-kit). Run them from your machine with scripts/deploy/zeabur-db.sh <env> migrate (verified pg_dump backup first, temporary port always closed) before deploying the new code — see Deployment. Keep migrations additive (backward-compatible column add first, deploy, cleanup later) so the previous release still runs on the new schema and a rollback is safe.

Deploy dev-docs to Cloudflare Pages ​

See deploy/cloudflare-pages.md for the full config. Short version:

bash
# Set env var
export CLOUDFLARE_API_TOKEN=<your token>

# Run the gh-cf-deploy skill from Claude Code
/gh-cf-deploy

Build settings for Cloudflare Pages:

  • Root: dev-docs
  • Build command: pnpm build
  • Output: .vitepress/dist

Environment Variables for dev-docs Build ​

VarPurpose
VITEPRESS_API_BASEBase URL for the API playground (e.g. https://app.zeabur.app)

Smoke Test After Deploy ​

bash
# Health check
curl https://your-app.zeabur.app/api/health
# Expected: { "status": "ok" }

# Sign in(工牌編號 + 密碼)
curl -X POST https://your-app.zeabur.app/api/auth/signin \
  -H "Content-Type: application/json" \
  -d '{"badge":"R90001","password":"Admin123!"}'

Released under the MIT License.