Easy Setup Ci Cd
Production-ready command that handles setup, comprehensive, pipeline, automated. Includes structured workflows, validation checks, and reusable patterns for setup.
Easy Setup CI/CD
Set up a complete CI/CD pipeline with build automation, testing, quality gates, deployment strategies, and monitoring integration for GitHub Actions, GitLab CI, or Azure Pipelines.
When to Use This Command
Run this command when...
- You are setting up automated build, test, and deployment workflows for a new or existing project
- You need GitHub Actions workflows, GitLab CI pipelines, or Azure Pipelines configurations generated from scratch
- You want quality gates including linting, security scanning, and code coverage thresholds in your pipeline
- You need deployment automation with blue-green, canary, or rolling deployment strategies
- You want secrets management, environment provisioning, and approval workflows integrated into your pipeline
Quick Start
# .claude/commands/easy-setup-ci-cd.yaml name: Easy Setup CI/CD description: Setup comprehensive CI/CD pipeline with deployment automation inputs: - name: platform description: "github-actions, gitlab-ci, or azure-pipelines" default: "github-actions"
# Setup GitHub Actions CI/CD claude "easy-setup-ci-cd --platform github-actions" # Setup with specific deployment target claude "easy-setup-ci-cd --platform github-actions --deploy vercel --env staging,production"
Output:
[detect] Repository: GitHub (origin: github.com/org/repo)
[detect] Stack: Node.js 20, React, PostgreSQL
[create] .github/workflows/ci.yml (lint, test, build)
[create] .github/workflows/deploy-staging.yml
[create] .github/workflows/deploy-production.yml
[config] Quality gates: coverage > 80%, 0 lint errors
[config] Deploy: Vercel preview on PR, production on main
Done. 3 workflow files created. Push to activate.
Core Concepts
| Concept | Description |
|---|---|
| Pipeline Architecture | Multi-stage pipeline: install, lint, test, build, deploy with parallel job execution |
| Quality Gates | Automated checks that block deployment: test pass rate, coverage thresholds, lint results, security scans |
| Deployment Strategies | Blue-green (zero downtime), canary (gradual rollout), or rolling deployments with rollback triggers |
| Environment Management | Separate staging and production pipelines with environment-specific secrets and configurations |
| Approval Workflows | Required manual approvals before production deployments with notification to designated reviewers |
Pipeline Flow:
Push/PR
β
βββΌβββββββ ββββββββββ ββββββββββ ββββββββββ
βInstall βββ>β Lint βββ>β Test βββ>β Build β
β Deps β β& Formatβ β& Cover β βArtifactβ
βββββββββββ ββββββββββ ββββββββββ βββββ¬βββββ
β
ββββββββββββββββββ€
βΌ βΌ
βββββββββββ ββββββββββββ
β Staging βββββ>βProductionβ
β Deploy β β (Approve)β
βββββββββββ ββββββββββββ
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
platform | string | "github-actions" | CI/CD platform: github-actions, gitlab-ci, or azure-pipelines |
deploy | string | "" | Deployment target: vercel, aws, gcp, netlify, or docker registry |
env | string | "staging,production" | Comma-separated environment names to create pipelines for |
coverage | integer | 80 | Minimum code coverage percentage required to pass quality gate |
strategy | string | "rolling" | Deployment strategy: rolling, blue-green, or canary |
Best Practices
- Start with CI before CD -- Get your build and test pipeline green before adding deployment automation. A deployment pipeline built on unreliable tests creates false confidence.
- Cache dependencies aggressively -- Configure npm, pip, or cargo caching in your pipeline to reduce build times from minutes to seconds on repeated runs.
- Use matrix builds for cross-version testing -- Test against multiple Node.js, Python, or runtime versions to catch compatibility issues before users report them.
- Require staging deployment before production -- Never deploy directly to production. The pipeline should enforce staging deployment and verification as a prerequisite.
- Store secrets in the platform's vault -- Use GitHub Secrets, GitLab CI variables, or Azure Key Vault. Never hardcode credentials in pipeline configuration files.
Common Issues
- Workflow not triggering -- GitHub Actions workflows must be in
.github/workflows/on the default branch to be recognized. Push the workflow files to main first. - Secrets not available in pull requests -- For security, most CI platforms do not expose secrets to pull requests from forks. Use a separate workflow for community contributions.
- Build cache not working -- Cache keys must match exactly. If dependencies change but the cache key does not, stale caches produce build failures. Include lock file hashes in cache keys.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.