Skip to content
DevOpsIntermediate1 min read

CI/CD Pipeline for Monorepo

GitHub Actions workflow with turborepo caching, parallel test execution, preview deployments, and Slack notifications.

ClaudeChatGPTGitHub ActionsTurborepoDocker

Copy the prompt below into your AI coding tool. For persistent use, save it as a CLAUDE.md file in your project root or use it as a system prompt.

#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

  1. Detect Changes β€” Only run jobs for affected packages
  2. Lint & Type Check β€” Parallel per package
  3. Unit Tests β€” Parallel with coverage reporting
  4. Integration Tests β€” Database tests with test containers
  5. Build β€” Parallel builds with remote caching
  6. Preview Deploy β€” Vercel preview for web, staging API
  7. Production Deploy β€” On merge to main
  8. 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.

Orel OhayonΒ·
View all prompts