CI/CD pipeline for a monorepo with path-based triggers, parallel builds, shared caching, and conditional deployments per package.
## Task CI/CD pipeline for a monorepo with path-based triggers and parallel builds. ## Requirements - Monorepo structure: packages/api, packages/web, packages/shared - Path-based triggers: only build what changed - Shared dependency caching - Matrix builds for multiple Node versions - Conditional deployment per package ## Workflow ```yaml # Generate .github/workflows/ci.yml with: on: push: branches: [main] pull_request: jobs: detect-changes: # Use dorny/paths-filter to detect which packages changed # Output: api_changed, web_changed, shared_changed test-api: needs: detect-changes if: needs.detect-changes.outputs.api_changed == 'true' strategy: matrix: node: [20, 22] steps: # Checkout, setup Node, restore cache, install, lint, test, build test-web: needs: detect-changes if: needs.detect-changes.outputs.web_changed == 'true' steps: # Same pattern, plus Playwright E2E tests deploy-api: needs: [test-api] if: github.ref == 'refs/heads/main' # Deploy to staging → run smoke tests → promote to production deploy-web: needs: [test-web] if: github.ref == 'refs/heads/main' # Build → deploy to Vercel/Cloudflare → invalidate CDN cache ``` ## Implementation Notes 1. Cache: pnpm store + turbo cache (shared across jobs) 2. Concurrency: cancel in-progress runs on same PR 3. Artifacts: upload test reports and coverage 4. Secrets: use environment-scoped secrets (staging vs production) 5. Notifications: Slack on failure, GitHub deployment status 6. Reusable workflows: extract common steps into .github/workflows/shared-*.yml
No gallery images yet.