<< All versions
Skill v1.0.2
currentAutomated scan100/100rmyndharis/antigravity-skills/deployment-pipeline-design
+2 new
──Details
PublishedJune 14, 2026 at 02:21 PM
Content Hashsha256:c233a355d91759b3...
Git SHA890b753b218c
Bump Typepatch
──Files
Files (1 file, 8.4 KB)
SKILL.md8.4 KBactive
SKILL.md · 366 lines · 8.4 KB
version: "1.0.2" name: deployment-pipeline-design description: 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.
Deployment Pipeline Design
Architecture patterns for multi-stage CI/CD pipelines with approval gates and deployment strategies.
Do not use this skill when
- The task is unrelated to deployment pipeline design
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
Purpose
Design robust, secure deployment pipelines that balance speed with safety through proper stage organization and approval workflows.
Use this skill when
- 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
yaml
# GitHub Actionsproduction-deploy:needs: staging-deployenvironment:name: productionurl: https://app.example.comruns-on: ubuntu-lateststeps:- name: Deploy to productionrun: |# Deployment commands
Pattern 2: Time-Based Approval
yaml
# GitLab CIdeploy:production:stage: deployscript:- deploy.sh productionenvironment:name: productionwhen: delayedstart_in: 30 minutesonly:- main
Pattern 3: Multi-Approver
yaml
# Azure Pipelinesstages:- stage: ProductiondependsOn: Stagingjobs:- deployment: Deployenvironment:name: productionresourceType: Kubernetesstrategy:runOnce:preDeploy:steps:- task: ManualValidation@0inputs:notifyUsers: 'team-leads@example.com'instructions: 'Review staging metrics before approving'
Deployment Strategies
1. Rolling Deployment
yaml
apiVersion: apps/v1kind: Deploymentmetadata:name: my-appspec:replicas: 10strategy:type: RollingUpdaterollingUpdate:maxSurge: 2maxUnavailable: 1
Characteristics:
- Gradual rollout
- Zero downtime
- Easy rollback
- Best for most applications
2. Blue-Green Deployment
yaml
# Blue (current)kubectl apply -f blue-deployment.yamlkubectl label service my-app version=blue# Green (new)kubectl apply -f green-deployment.yaml# Test green environmentkubectl label service my-app version=green# Rollback if neededkubectl label service my-app version=blue
Characteristics:
- Instant switchover
- Easy rollback
- Doubles infrastructure cost temporarily
- Good for high-risk deployments
3. Canary Deployment
yaml
apiVersion: argoproj.io/v1alpha1kind: Rolloutmetadata:name: my-appspec:replicas: 10strategy:canary:steps:- setWeight: 10- pause: {duration: 5m}- setWeight: 25- pause: {duration: 5m}- setWeight: 50- pause: {duration: 5m}- setWeight: 100
Characteristics:
- Gradual traffic shift
- Risk mitigation
- Real user testing
- Requires service mesh or similar
4. Feature Flags
python
from flagsmith import Flagsmithflagsmith = Flagsmith(environment_key="API_KEY")if flagsmith.has_feature("new_checkout_flow"):# New code pathprocess_checkout_v2()else:# Existing code pathprocess_checkout_v1()
Characteristics:
- Deploy without releasing
- A/B testing
- Instant rollback
- Granular control
Pipeline Orchestration
Multi-Stage Pipeline Example
yaml
name: Production Pipelineon:push:branches: [ main ]jobs:build:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4- name: Build applicationrun: make build- name: Build Docker imagerun: docker build -t myapp:${{ github.sha }} .- name: Push to registryrun: docker push myapp:${{ github.sha }}test:needs: buildruns-on: ubuntu-lateststeps:- name: Unit testsrun: make test- name: Security scanrun: trivy image myapp:${{ github.sha }}deploy-staging:needs: testruns-on: ubuntu-latestenvironment:name: stagingsteps:- name: Deploy to stagingrun: kubectl apply -f k8s/staging/integration-test:needs: deploy-stagingruns-on: ubuntu-lateststeps:- name: Run E2E testsrun: npm run test:e2edeploy-production:needs: integration-testruns-on: ubuntu-latestenvironment:name: productionsteps:- name: Canary deploymentrun: |kubectl apply -f k8s/production/kubectl argo rollouts promote my-appverify:needs: deploy-productionruns-on: ubuntu-lateststeps:- name: Health checkrun: curl -f https://app.example.com/health- name: Notify teamrun: |curl -X POST ${{ secrets.SLACK_WEBHOOK }} \-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
yaml
deploy-and-verify:steps:- name: Deploy new versionrun: kubectl apply -f k8s/- name: Wait for rolloutrun: kubectl rollout status deployment/my-app- name: Health checkid: healthrun: |for i in {1..10}; doif curl -sf https://app.example.com/health; thenexit 0fisleep 10doneexit 1- name: Rollback on failureif: failure()run: kubectl rollout undo deployment/my-app
Manual Rollback
bash
# List revision historykubectl rollout history deployment/my-app# Rollback to previous versionkubectl rollout undo deployment/my-app# Rollback to specific revisionkubectl 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
yaml
- name: Post-deployment verificationrun: |# Wait for metrics stabilizationsleep 60# Check error rateERROR_RATE=$(curl -s "$PROMETHEUS_URL/api/v1/query?query=rate(http_errors_total[5m])" | jq '.data.result[0].value[1]')if (( $(echo "$ERROR_RATE > 0.01" | bc -l) )); thenecho "Error rate too high: $ERROR_RATE"exit 1fi
Related Skills
github-actions-templates- For GitHub Actions implementationgitlab-ci-patterns- For GitLab CI implementationsecrets-management- For secrets handling