| name | deployment-pipeline |
| description | Defines CI/CD stages, deployment gates, environment protection, and rollback procedures. Trigger on 'CI/CD', 'deploy', 'pipeline', 'GitHub Actions workflow', 'staging environment', 'rollback procedure'. DO NOT USE for semantic versioning, tagging, or changelog generation (use release-engineering) or infrastructure provisioning (use stack-standards). |
| license | Apache-2.0 |
| compatibility | {"clients":["openai-codex","gemini-cli","opencode","github-copilot"]} |
| metadata | {"owner":"codex","domain":"deployment-pipeline","maturity":"draft","risk":"low","tags":["deployment","pipeline"]} |
Purpose
Design CI/CD pipelines that safely move code from commit to production: build → test → lint → staging deploy → smoke test → production deploy. Define gate conditions at each stage and automatic rollback triggers to catch failures before users do.
When to use this skill
Use when:
- Setting up CI/CD for a new project
- Current deployment is manual or unreliable
- Adding staging/preview environments
- Implementing deployment gates or approval workflows
Do NOT use when:
- Local development scripts only (no deployment target)
- Project already has mature CI/CD (make incremental improvements instead)
Operating procedure
-
Define pipeline stages:
name: Deploy Pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
test:
needs: build
lint:
deploy-staging:
needs: [test, lint]
if: github.ref == 'refs/heads/main'
smoke-test:
needs: deploy-staging
deploy-production:
needs: smoke-test
environment: production
-
Configure environment protection (GitHub example):
deploy-production:
environment:
name: production
url: https://myapp.com
Output defaults
name: CI/CD Pipeline
on:
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: npm ci && npm run build
- uses: actions/upload-artifact@v4
with:
name: build
path: dist/
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm test
lint:
runs-on: ubuntu-latest
steps:
- uses:
[, ]
References
Failure handling
- Flaky tests blocking deployment: Quarantine flaky tests; fix them but don't let them block all deploys
- Staging differs from production: Use infrastructure-as-code; staging should mirror prod configuration
- Rollback script doesn't work: Test rollback procedure regularly; include in deployment verification
- Secrets exposed in logs: Use
add-mask command; never echo environment variables containing secrets
- Concurrent deploys cause conflicts: Use
concurrency groups; consider deploy locks for shared infrastructure