deployment-automation
About
This Claude Skill automates deployment pipelines using Helm, Terraform, and ArgoCD to safely promote applications across environments. It enables advanced deployment strategies like blue-green and canary releases, and includes automated rollback procedures for risk mitigation. Use it for continuous Kubernetes deployment, infrastructure provisioning, and multi-environment management.
Documentation
Deployment Automation
Overview
Establish automated deployment pipelines that safely and reliably move applications across development, staging, and production environments with minimal manual intervention and risk.
When to Use
- Continuous deployment to Kubernetes
- Infrastructure as Code deployment
- Multi-environment promotion
- Blue-green deployment strategies
- Canary release management
- Infrastructure provisioning
- Automated rollback procedures
Implementation Examples
1. Helm Deployment Chart
# helm/Chart.yaml
apiVersion: v2
name: myapp
description: My awesome application
type: application
version: 1.0.0
# helm/values.yaml
replicaCount: 3
image:
repository: ghcr.io/myorg/myapp
pullPolicy: IfNotPresent
tag: "1.0.0"
service:
type: ClusterIP
port: 80
targetPort: 3000
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
2. GitHub Actions Deployment Workflow
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'staging'
type: choice
options:
- staging
- production
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.environment || 'staging' }}
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v3
- name: Determine target environment
id: env
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "environment=staging" >> $GITHUB_OUTPUT
else
echo "environment=staging" >> $GITHUB_OUTPUT
fi
- name: Setup kubectl
uses: azure/setup-kubectl@v3
with:
version: 'latest'
- name: Configure kubectl
run: |
mkdir -p $HOME/.kube
echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > $HOME/.kube/config
chmod 600 $HOME/.kube/config
- name: Deploy with Helm
run: |
helm repo add myrepo ${{ secrets.HELM_REPO_URL }}
helm repo update
helm upgrade --install myapp myrepo/myapp \
--namespace ${{ steps.env.outputs.environment }} \
--create-namespace \
--values helm/values-${{ steps.env.outputs.environment }}.yaml \
--set image.tag=${{ github.sha }} \
--wait \
--timeout 5m
- name: Verify deployment
run: |
kubectl rollout status deployment/myapp \
-n ${{ steps.env.outputs.environment }} \
--timeout=5m
3. ArgoCD Deployment
# argocd/myapp-app.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/myorg/helm-charts
targetRevision: HEAD
path: myapp
helm:
releaseName: myapp
values: |
image:
tag: v1.0.0
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
5. Blue-Green Deployment
#!/bin/bash
# Deploy green, run tests, switch traffic
helm upgrade --install myapp-green ./chart --set version=v2.0.0 --wait
kubectl run smoke-test --image=postman/newman --rm -- run tests/smoke.json
if [ $? -eq 0 ]; then
kubectl patch service myapp -p '{"spec":{"selector":{"version":"v2.0.0"}}}'
echo "✅ Traffic switched to green"
else
helm uninstall myapp-green
exit 1
fi
Best Practices
✅ DO
- Use Infrastructure as Code (Terraform, Helm)
- Implement GitOps workflows
- Use blue-green deployments
- Implement canary releases
- Automate rollback procedures
- Test deployments in staging first
- Use feature flags for gradual rollout
- Monitor deployment health
- Document deployment procedures
- Implement approval gates for production
- Version infrastructure code
- Use environment parity
❌ DON'T
- Deploy directly to production
- Skip testing in staging
- Use manual deployment scripts
- Deploy without rollback plan
- Ignore health checks
- Use hardcoded configuration
- Deploy during critical hours
- Skip pre-deployment validation
- Forget to backup before deploy
- Deploy from local machines
Deployment Checklist
# Pre-deployment verification
- [ ] Run tests in staging
- [ ] Verify database migrations
- [ ] Check infrastructure capacity
- [ ] Review changelog
- [ ] Verify rollback plan
- [ ] Notify stakeholders
- [ ] Monitor error rates
- [ ] Prepare rollback script
Resources
Quick Install
/plugin add https://github.com/aj-geddes/useful-ai-prompts/tree/main/deployment-automationCopy and paste this command in Claude Code to install this skill
GitHub 仓库
Related Skills
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
Algorithmic Art Generation
MetaThis skill helps developers create algorithmic art using p5.js, focusing on generative art, computational aesthetics, and interactive visualizations. It automatically activates for topics like "generative art" or "p5.js visualization" and guides you through creating unique algorithms with features like seeded randomness, flow fields, and particle systems. Use it when you need to build reproducible, code-driven artistic patterns.
business-rule-documentation
MetaThis skill provides standardized templates for systematically documenting business logic and domain knowledge following Domain-Driven Design principles. It helps developers capture business rules, process flows, decision trees, and terminology glossaries to maintain consistency between requirements and implementation. Use it when documenting domain models, creating business rule repositories, or bridging communication between business and technical teams.
huggingface-accelerate
DevelopmentHuggingFace Accelerate provides the simplest API for adding distributed training to PyTorch scripts with just 4 lines of code. It offers a unified interface for multiple distributed training frameworks like DeepSpeed, FSDP, and DDP while handling automatic device placement and mixed precision. This makes it ideal for developers who want to quickly scale their PyTorch training across multiple GPUs or nodes without complex configuration.
