Deployment Pipeline Design
Design secure, scalable CI/CD pipelines with approval gates and smart rollback
✨ The solution you've been looking for
Design multi-stage CI/CD pipelines with approval gates, security checks, and deployment orchestration. Use when architecting deployment workflows, setting up continuous delivery, or implementing GitOps practices.
See It In Action
Interactive preview & real-world examples
AI Conversation Simulator
See how users interact with this skill
User Prompt
Help me design a CI/CD pipeline for a microservice that needs security scanning, staging environment testing, and manual approval before production deployment
Skill Processing
Analyzing request...
Agent Response
Complete pipeline architecture with stage definitions, approval workflows, deployment strategies, and rollback procedures
Quick Start (3 Steps)
Get up and running in minutes
Install
claude-code skill install deployment-pipeline-design
claude-code skill install deployment-pipeline-designConfig
First Trigger
@deployment-pipeline-design helpCommands
| Command | Description | Required Args |
|---|---|---|
| @deployment-pipeline-design multi-stage-production-pipeline | Design a complete CI/CD pipeline with build, test, staging, approval gates, and production deployment stages | None |
| @deployment-pipeline-design deployment-strategy-selection | Choose and implement the right deployment strategy (rolling, blue-green, canary) based on application requirements | None |
| @deployment-pipeline-design approval-gate-implementation | Set up approval workflows with time delays, multi-approver requirements, and automated verification | None |
Typical Use Cases
Multi-Stage Production Pipeline
Design a complete CI/CD pipeline with build, test, staging, approval gates, and production deployment stages
Deployment Strategy Selection
Choose and implement the right deployment strategy (rolling, blue-green, canary) based on application requirements
Approval Gate Implementation
Set up approval workflows with time delays, multi-approver requirements, and automated verification
Overview
Deployment Pipeline Design
Architecture patterns for multi-stage CI/CD pipelines with approval gates and deployment strategies.
Purpose
Design robust, secure deployment pipelines that balance speed with safety through proper stage organization and approval workflows.
When to Use
- Design CI/CD architecture
- Implement deployment gates
- Configure multi-environment pipelines
- Establish deployment best practices
- Implement progressive delivery
Pipeline Stages
Standard Pipeline Flow
┌─────────┐ ┌──────┐ ┌─────────┐ ┌────────┐ ┌──────────┐
│ Build │ → │ Test │ → │ Staging │ → │ Approve│ → │Production│
└─────────┘ └──────┘ └─────────┘ └────────┘ └──────────┘
Detailed Stage Breakdown
- Source - Code checkout
- Build - Compile, package, containerize
- Test - Unit, integration, security scans
- Staging Deploy - Deploy to staging environment
- Integration Tests - E2E, smoke tests
- Approval Gate - Manual approval required
- Production Deploy - Canary, blue-green, rolling
- Verification - Health checks, monitoring
- Rollback - Automated rollback on failure
Approval Gate Patterns
Pattern 1: Manual Approval
1# GitHub Actions
2production-deploy:
3 needs: staging-deploy
4 environment:
5 name: production
6 url: https://app.example.com
7 runs-on: ubuntu-latest
8 steps:
9 - name: Deploy to production
10 run: |
11 # Deployment commands
Pattern 2: Time-Based Approval
1# GitLab CI
2deploy:production:
3 stage: deploy
4 script:
5 - deploy.sh production
6 environment:
7 name: production
8 when: delayed
9 start_in: 30 minutes
10 only:
11 - main
Pattern 3: Multi-Approver
1# Azure Pipelines
2stages:
3 - stage: Production
4 dependsOn: Staging
5 jobs:
6 - deployment: Deploy
7 environment:
8 name: production
9 resourceType: Kubernetes
10 strategy:
11 runOnce:
12 preDeploy:
13 steps:
14 - task: ManualValidation@0
15 inputs:
16 notifyUsers: "team-leads@example.com"
17 instructions: "Review staging metrics before approving"
Reference: See assets/approval-gate-template.yml
Deployment Strategies
1. Rolling Deployment
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4 name: my-app
5spec:
6 replicas: 10
7 strategy:
8 type: RollingUpdate
9 rollingUpdate:
10 maxSurge: 2
11 maxUnavailable: 1
Characteristics:
- Gradual rollout
- Zero downtime
- Easy rollback
- Best for most applications
2. Blue-Green Deployment
1# Blue (current)
2kubectl apply -f blue-deployment.yaml
3kubectl label service my-app version=blue
4
5# Green (new)
6kubectl apply -f green-deployment.yaml
7# Test green environment
8kubectl label service my-app version=green
9
10# Rollback if needed
11kubectl label service my-app version=blue
Characteristics:
- Instant switchover
- Easy rollback
- Doubles infrastructure cost temporarily
- Good for high-risk deployments
3. Canary Deployment
1apiVersion: argoproj.io/v1alpha1
2kind: Rollout
3metadata:
4 name: my-app
5spec:
6 replicas: 10
7 strategy:
8 canary:
9 steps:
10 - setWeight: 10
11 - pause: { duration: 5m }
12 - setWeight: 25
13 - pause: { duration: 5m }
14 - setWeight: 50
15 - pause: { duration: 5m }
16 - setWeight: 100
Characteristics:
- Gradual traffic shift
- Risk mitigation
- Real user testing
- Requires service mesh or similar
4. Feature Flags
1from flagsmith import Flagsmith
2
3flagsmith = Flagsmith(environment_key="API_KEY")
4
5if flagsmith.has_feature("new_checkout_flow"):
6 # New code path
7 process_checkout_v2()
8else:
9 # Existing code path
10 process_checkout_v1()
Characteristics:
- Deploy without releasing
- A/B testing
- Instant rollback
- Granular control
Pipeline Orchestration
Multi-Stage Pipeline Example
1name: Production Pipeline
2
3on:
4 push:
5 branches: [main]
6
7jobs:
8 build:
9 runs-on: ubuntu-latest
10 steps:
11 - uses: actions/checkout@v4
12 - name: Build application
13 run: make build
14 - name: Build Docker image
15 run: docker build -t myapp:${{ github.sha }} .
16 - name: Push to registry
17 run: docker push myapp:${{ github.sha }}
18
19 test:
20 needs: build
21 runs-on: ubuntu-latest
22 steps:
23 - name: Unit tests
24 run: make test
25 - name: Security scan
26 run: trivy image myapp:${{ github.sha }}
27
28 deploy-staging:
29 needs: test
30 runs-on: ubuntu-latest
31 environment:
32 name: staging
33 steps:
34 - name: Deploy to staging
35 run: kubectl apply -f k8s/staging/
36
37 integration-test:
38 needs: deploy-staging
39 runs-on: ubuntu-latest
40 steps:
41 - name: Run E2E tests
42 run: npm run test:e2e
43
44 deploy-production:
45 needs: integration-test
46 runs-on: ubuntu-latest
47 environment:
48 name: production
49 steps:
50 - name: Canary deployment
51 run: |
52 kubectl apply -f k8s/production/
53 kubectl argo rollouts promote my-app
54
55 verify:
56 needs: deploy-production
57 runs-on: ubuntu-latest
58 steps:
59 - name: Health check
60 run: curl -f https://app.example.com/health
61 - name: Notify team
62 run: |
63 curl -X POST ${{ secrets.SLACK_WEBHOOK }} \
64 -d '{"text":"Production deployment successful!"}'
Pipeline Best Practices
- Fail fast - Run quick tests first
- Parallel execution - Run independent jobs concurrently
- Caching - Cache dependencies between runs
- Artifact management - Store build artifacts
- Environment parity - Keep environments consistent
- Secrets management - Use secret stores (Vault, etc.)
- Deployment windows - Schedule deployments appropriately
- Monitoring integration - Track deployment metrics
- Rollback automation - Auto-rollback on failures
- Documentation - Document pipeline stages
Rollback Strategies
Automated Rollback
1deploy-and-verify:
2 steps:
3 - name: Deploy new version
4 run: kubectl apply -f k8s/
5
6 - name: Wait for rollout
7 run: kubectl rollout status deployment/my-app
8
9 - name: Health check
10 id: health
11 run: |
12 for i in {1..10}; do
13 if curl -sf https://app.example.com/health; then
14 exit 0
15 fi
16 sleep 10
17 done
18 exit 1
19
20 - name: Rollback on failure
21 if: failure()
22 run: kubectl rollout undo deployment/my-app
Manual Rollback
1# List revision history
2kubectl rollout history deployment/my-app
3
4# Rollback to previous version
5kubectl rollout undo deployment/my-app
6
7# Rollback to specific revision
8kubectl rollout undo deployment/my-app --to-revision=3
Monitoring and Metrics
Key Pipeline Metrics
- Deployment Frequency - How often deployments occur
- Lead Time - Time from commit to production
- Change Failure Rate - Percentage of failed deployments
- Mean Time to Recovery (MTTR) - Time to recover from failure
- Pipeline Success Rate - Percentage of successful runs
- Average Pipeline Duration - Time to complete pipeline
Integration with Monitoring
1- name: Post-deployment verification
2 run: |
3 # Wait for metrics stabilization
4 sleep 60
5
6 # Check error rate
7 ERROR_RATE=$(curl -s "$PROMETHEUS_URL/api/v1/query?query=rate(http_errors_total[5m])" | jq '.data.result[0].value[1]')
8
9 if (( $(echo "$ERROR_RATE > 0.01" | bc -l) )); then
10 echo "Error rate too high: $ERROR_RATE"
11 exit 1
12 fi
Reference Files
references/pipeline-orchestration.md- Complex pipeline patternsassets/approval-gate-template.yml- Approval workflow templates
Related Skills
github-actions-templates- For GitHub Actions implementationgitlab-ci-patterns- For GitLab CI implementationsecrets-management- For secrets handling
What Users Are Saying
Real feedback from the community
Environment Matrix
Dependencies
Framework Support
Context Window
Security & Privacy
Information
- Author
- wshobson
- Updated
- 2026-01-30
- Category
- architecture-patterns
Related Skills
Deployment Pipeline Design
Design multi-stage CI/CD pipelines with approval gates, security checks, and deployment …
View Details →Gitlab Ci Patterns
Build GitLab CI/CD pipelines with multi-stage workflows, caching, and distributed runners for …
View Details →Gitlab Ci Patterns
Build GitLab CI/CD pipelines with multi-stage workflows, caching, and distributed runners for …
View Details →