deployment-engineer by charon-fan/agent-playbook
npx skills add https://github.com/charon-fan/agent-playbook --skill deployment-engineer专注于部署自动化、CI/CD 流水线和基础设施管理的专家。
当您进行以下操作时触发:
stages:
- lint
- test
- build
- security
- deploy-dev
- deploy-staging
- deploy-production
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
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
┌─────────┐
│ 负载 │
│ 均衡器 │
└────┬────┘
│
┌────────┴────────┐
│ 切换器 │
├────────┬────────┤
▼ ▼ ▼
┌─────┐ ┌─────┐ ┌─────┐
│蓝环境│ │绿环境│ │ │
└─────┘ └─────┘ └─────┘
┌─────────────────────────────────────┐
│ v1 v1 v1 v1 v1 v1 v1 v1 v1 │ → 旧版本
│ v2 v2 v2 v2 v2 v2 v2 v2 v2 │ → 新版本
└─────────────────────────────────────┘
▲ ▲
│ │
开始 结束
┌──────────────────────────────────────┐
│ v1 v1 v1 v1 v1 v1 v1 v1 v1 v1 │ → 旧版本
│ v2 v2 v2 v2 │ → 金丝雀版本 (5%)
└──────────────────────────────────────┘
监控指标,然后:
│ v1 v1 v1 v1 │ → 旧版本 (50%)
│ v2 v2 v2 v2 v2 v2 v2 v2 v2 v2 │ → 新版本 (50%)
# 生产环境
NODE_ENV=production
DATABASE_URL=postgresql://...
API_KEY=sk-...
SENTRY_DSN=https://example.com/123
# 开发环境
NODE_ENV=development
DATABASE_URL=postgresql://localhost:5432/dev
// config/production.ts
export default {
database: {
url: process.env.DATABASE_URL,
poolSize: 20,
},
redis: {
url: process.env.REDIS_URL,
},
};
// 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);
});
# Kubernetes
kubectl rollout undo deployment/app
# Docker
docker-compose down
docker-compose up -d --scale app=<previous-version>
# Git
git revert HEAD
git push
// 结构化日志
logger.info('Deployment started', {
version: process.env.VERSION,
environment: process.env.NODE_ENV,
timestamp: new Date().toISOString(),
});
生成部署配置:
python scripts/generate_deploy.py <environment>
验证部署:
python scripts/validate_deploy.py
references/pipelines.md - CI/CD 流水线示例references/kubernetes.md - K8s 部署配置references/monitoring.md - 监控设置每周安装量
42
代码仓库
GitHub 星标数
10
首次出现
2026年1月22日
安全审计
已安装于
opencode35
codex35
gemini-cli35
cursor35
github-copilot31
amp29
Specialist in deployment automation, CI/CD pipelines, and infrastructure management.
Activates when you:
stages:
- lint
- test
- build
- security
- deploy-dev
- deploy-staging
- deploy-production
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
┌─────────┐
│ Load │
│ Balancer│
└────┬────┘
│
┌────────┴────────┐
│ Switch │
├────────┬────────┤
▼ ▼ ▼
┌─────┐ ┌─────┐ ┌─────┐
│Blue │ │Green│ │ │
└─────┘ └─────┘ └─────┘
┌─────────────────────────────────────┐
│ v1 v1 v1 v1 v1 v1 v1 v1 v1 │ → Old
│ v2 v2 v2 v2 v2 v2 v2 v2 v2 │ → New
└─────────────────────────────────────┘
▲ ▲
│ │
Start End
┌──────────────────────────────────────┐
│ 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%)
# 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
// config/production.ts
export default {
database: {
url: process.env.DATABASE_URL,
poolSize: 20,
},
redis: {
url: process.env.REDIS_URL,
},
};
// 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);
});
# Kubernetes
kubectl rollout undo deployment/app
# Docker
docker-compose down
docker-compose up -d --scale app=<previous-version>
# Git
git revert HEAD
git push
// Structured logging
logger.info('Deployment started', {
version: process.env.VERSION,
environment: process.env.NODE_ENV,
timestamp: new Date().toISOString(),
});
Generate deployment config:
python scripts/generate_deploy.py <environment>
Validate deployment:
python scripts/validate_deploy.py
references/pipelines.md - CI/CD pipeline examplesreferences/kubernetes.md - K8s deployment configsreferences/monitoring.md - Monitoring setupWeekly Installs
42
Repository
GitHub Stars
10
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode35
codex35
gemini-cli35
cursor35
github-copilot31
amp29