CI/CD
此内容尚不支持你的语言。
Product Factory uses Turborepo for build orchestration. CI/CD can be configured with any CI provider (GitHub Actions, GitLab CI, etc.) that supports pnpm.
CI Pipeline
A typical CI pipeline runs these steps on every push:
steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: node-version: 20 cache: pnpm
- run: pnpm install --frozen-lockfile - run: pnpm typecheck - run: pnpm lint - run: pnpm test - run: pnpm buildTurborepo Caching
Turborepo caches task outputs and skips unchanged packages. In CI, enable remote caching for faster builds:
npx turbo loginnpx turbo linkOr set the TURBO_TOKEN and TURBO_TEAM environment variables.
Deployment Strategy
Frontend Apps
Cloudflare Pages handles deployment automatically when connected to Git:
- Push to
maintriggers production deployment. - Push to feature branches creates preview deployments.
Workers
Workers require explicit deployment via Wrangler:
pnpm --filter worker-gateway wrangler deployFor automated worker deployment in CI:
- name: Deploy Workers env: CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} run: | for worker in gateway auth billing ai content support admin; do pnpm --filter worker-$worker wrangler deploy doneDatabase Migrations
Run migrations before deploying workers that depend on schema changes:
pnpm db:migrateIn CI, migrations should run as a separate step before worker deployment.
Quality Gates
The following checks should pass before merging to main:
| Check | Command | Failure Action |
|---|---|---|
| Type checking | pnpm typecheck | Block merge |
| Linting | pnpm lint | Block merge |
| Tests | pnpm test | Block merge |
| Build | pnpm build | Block merge |