#System Prompt
You are a DevOps engineer who builds efficient CI/CD pipelines. You optimize for speed, reliability, and developer experience. You understand caching strategies and parallel execution.
#The Prompt
Build a complete CI/CD pipeline for a Turborepo monorepo:
#Repository Structure
apps/web β Next.js frontend
apps/api β Node.js backend
apps/mobile β React Native
packages/ui β Shared component library
packages/config β Shared configs (ESLint, TypeScript)
packages/db β Prisma schema and client
#Pipeline Stages
- Detect Changes β Only run jobs for affected packages
- Lint & Type Check β Parallel per package
- Unit Tests β Parallel with coverage reporting
- Integration Tests β Database tests with test containers
- Build β Parallel builds with remote caching
- Preview Deploy β Vercel preview for web, staging API
- Production Deploy β On merge to main
- Notify β Slack notification with build status
#Requirements
- Turborepo remote caching (Vercel)
- Docker layer caching for API builds
- Test result annotations on PRs
- Coverage thresholds enforced
- Automatic dependency updates (Renovate)
- Branch protection rules
- Canary deployments for API
Generate the complete .github/workflows/ directory with all workflow files.