‹ 首页

cd-pipeline-generator

@arabelatso · 收录于 1 周前

Generate GitHub Actions deployment workflows for automated deployment to staging and production environments on cloud platforms (AWS, GCP, Azure). Use when setting up continuous deployment pipelines, creating deployment automation, or configuring multi-environment deployment strategies. Includes templates for environment-specific deployments with approval gates, secrets management, and rollback capabilities.

适合你,如果需要在云平台上快速搭建带审批和回滚的部署流水线。

/ 下载安装
cd-pipeline-generator.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add arabelatso/skills-4-se/cd-pipeline-generator
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- arabelatso/skills-4-se/cd-pipeline-generator
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify arabelatso/skills-4-se/cd-pipeline-generator
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
137GitHub stars
~997最小装载
~997含声明引用
~2.2K文本包总量
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · Apache-2.0 · 0f00a4f

CD Pipeline Generator

Overview

Generate production-ready GitHub Actions deployment workflows that automate deployments to staging and production environments with environment protection rules, approval gates, and secrets management.

Workflow
1. Identify Deployment Target

Determine the cloud platform and deployment method:

  • AWS: ECS, Elastic Beanstalk, EC2, Lambda
  • GCP: Cloud Run, App Engine, Compute Engine, Cloud Functions
  • Azure: App Service, Container Instances, Functions
2. Select Template

Use the appropriate template from assets/ based on cloud platform:

  • deploy-aws.yml - AWS deployments (ECS, Elastic Beanstalk, Lambda)
  • deploy-gcp.yml - GCP deployments (Cloud Run, App Engine)
  • deploy-azure.yml - Azure deployments (App Service, Container Instances)
3. Configure Environments

Set up GitHub environment protection rules for staging and production:

Staging environment:

  • Auto-deploy on merge to main/master
  • No approval required
  • Use staging secrets and variables

Production environment:

  • Manual approval required
  • Deploy on workflow_dispatch or tag push
  • Use production secrets and variables
  • Optional: Restrict to specific branches
4. Configure Secrets

Add required secrets to GitHub repository settings (Settings → Secrets and variables → Actions):

AWS:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION

GCP:

  • GCP_PROJECT_ID
  • GCP_SERVICE_ACCOUNT_KEY

Azure:

  • AZURE_CREDENTIALS
  • AZURE_SUBSCRIPTION_ID
5. Customize Deployment Steps

Adapt the template to project-specific deployment needs:

Build artifacts: Add build steps before deployment

- name: Build application
  run: npm run build  # or: python -m build, go build, cargo build

Docker images: Build and push container images

- name: Build Docker image
  run: docker build -t $IMAGE_NAME:$TAG .

- name: Push to registry
  run: docker push $IMAGE_NAME:$TAG

Database migrations: Run migrations before deployment

- name: Run migrations
  run: npm run migrate  # or: alembic upgrade head, rails db:migrate

Health checks: Verify deployment success

- name: Health check
  run: curl -f https://$DEPLOYMENT_URL/health || exit 1
6. Set Deployment Triggers

Configure when deployments run:

Staging: Auto-deploy on push to main

on:
  push:
    branches: [main]

Production: Manual trigger or tag-based

on:
  workflow_dispatch:
  push:
    tags:
      - 'v*'
7. Place Workflow File

Create deployment workflow at .github/workflows/deploy.yml. If multiple deployment workflows are needed (e.g., separate staging and production), use descriptive names:

  • .github/workflows/deploy-staging.yml
  • .github/workflows/deploy-production.yml
Template Features

All templates include:

  • Environment separation: Distinct staging and production deployments
  • Approval gates: Production deployments require manual approval
  • Secrets management: Secure credential handling via GitHub secrets
  • Deployment status: Clear success/failure reporting
  • Rollback support: Easy revert to previous versions
  • Conditional execution: Deploy only when tests pass
Security Best Practices
  • Never commit credentials or API keys to the repository
  • Use GitHub environments to scope secrets appropriately
  • Enable required reviewers for production deployments
  • Use OIDC authentication instead of long-lived credentials when possible
  • Implement deployment windows for production (e.g., business hours only)
  • Add deployment notifications to Slack/email
Customization Examples

Add deployment notification:

- name: Notify deployment
  if: always()
  uses: 8398a7/action-slack@v3
  with:
    status: ${{ job.status }}
    text: 'Deployment to ${{ github.event.inputs.environment }} ${{ job.status }}'
  env:
    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

Add rollback capability:

- name: Rollback on failure
  if: failure()
  run: |
    echo "Deployment failed, rolling back..."
    # Platform-specific rollback commands

Restrict production deployment time:

- name: Check deployment window
  run: |
    HOUR=$(date +%H)
    if [ $HOUR -lt 9 ] || [ $HOUR -gt 17 ]; then
      echo "Deployments only allowed 9 AM - 5 PM"
      exit 1
    fi
Tips
  • Start with staging deployments to validate the workflow
  • Use environment-specific configuration files (e.g., config.staging.json, config.production.json)
  • Implement blue-green or canary deployments for zero-downtime updates
  • Add deployment metrics and monitoring
  • Document rollback procedures in the repository
  • Test deployment workflows in a separate test environment first
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。