deployment-engineer
20
总安装量
9
周安装量
#17990
全站排名
安装命令
npx skills add https://github.com/charon-fan/agent-playbook --skill deployment-engineer
Agent 安装分布
claude-code
8
antigravity
6
opencode
6
codex
6
windsurf
5
Skill 文档
Deployment Engineer
Specialist in deployment automation, CI/CD pipelines, and infrastructure management.
When This Skill Activates
Activates when you:
- Set up deployment pipeline
- Configure CI/CD
- Manage releases
- Automate infrastructure
CI/CD Pipeline
Pipeline Stages
stages:
- lint
- test
- build
- security
- deploy-dev
- deploy-staging
- deploy-production
GitHub Actions Example
name: CI/CD
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm run lint
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npm test
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: build
path: dist/
deploy-production:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
environment: production
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: build
path: dist/
- run: npm run deploy
Deployment Strategies
1. Blue-Green Deployment
âââââââââââ
â Load â
â Balancerâ
ââââââ¬âââââ
â
ââââââââââ´âââââââââ
â Switch â
ââââââââââ¬âââââââââ¤
â¼ â¼ â¼
âââââââ âââââââ âââââââ
âBlue â âGreenâ â â
âââââââ âââââââ âââââââ
2. Rolling Deployment
âââââââââââââââââââââââââââââââââââââââ
â v1 v1 v1 v1 v1 v1 v1 v1 v1 â â Old
â v2 v2 v2 v2 v2 v2 v2 v2 v2 â â New
âââââââââââââââââââââââââââââââââââââââ
â² â²
â â
Start End
3. Canary Deployment
ââââââââââââââââââââââââââââââââââââââââ
â v1 v1 v1 v1 v1 v1 v1 v1 v1 v1 â â Old
â v2 v2 v2 v2 â â Canary (5%)
ââââââââââââââââââââââââââââââââââââââââ
Monitor metrics, then:
â v1 v1 v1 v1 â â Old (50%)
â v2 v2 v2 v2 v2 v2 v2 v2 v2 v2 â â New (50%)
Environment Configuration
Environment Variables
# Production
NODE_ENV=production
DATABASE_URL=postgresql://...
API_KEY=sk-...
SENTRY_DSN=https://example.com/123
# Development
NODE_ENV=development
DATABASE_URL=postgresql://localhost:5432/dev
Configuration Management
// config/production.ts
export default {
database: {
url: process.env.DATABASE_URL,
poolSize: 20,
},
redis: {
url: process.env.REDIS_URL,
},
};
Health Checks
// GET /health
app.get('/health', (req, res) => {
const health = {
status: 'ok',
timestamp: new Date().toISOString(),
checks: {
database: 'ok',
redis: 'ok',
external_api: 'ok',
},
};
if (Object.values(health.checks).some(v => v !== 'ok')) {
health.status = 'degraded';
return res.status(503).json(health);
}
res.json(health);
});
Rollback Strategy
# Kubernetes
kubectl rollout undo deployment/app
# Docker
docker-compose down
docker-compose up -d --scale app=<previous-version>
# Git
git revert HEAD
git push
Monitoring & Logging
Metrics to Track
- Deployment frequency
- Lead time for changes
- Mean time to recovery (MTTR)
- Change failure rate
Logging
// Structured logging
logger.info('Deployment started', {
version: process.env.VERSION,
environment: process.env.NODE_ENV,
timestamp: new Date().toISOString(),
});
Scripts
Generate deployment config:
python scripts/generate_deploy.py <environment>
Validate deployment:
python scripts/validate_deploy.py
References
references/pipelines.md– CI/CD pipeline examplesreferences/kubernetes.md– K8s deployment configsreferences/monitoring.md– Monitoring setup