
Devops Deployment
- 1 installs
- 404 repo stars
- Updated August 5, 2026
- aiskillstore/marketplace
devops-deployment is a Claude skill providing CI/CD pipeline, containerization, Kubernetes, and infrastructure-as-code patterns for deploying applications.
About
This skill provides frameworks for CI/CD pipelines, containerization, deployment strategies, and infrastructure automation. It covers pipeline stages, container best practices, Kubernetes manifests, deployment strategies, Terraform, and GitOps with ArgoCD, plus a deployment checklist. A developer uses it when setting up pipelines, containerizing apps, or deploying to Kubernetes and cloud platforms.
- Frameworks for CI/CD pipelines, containerization, Kubernetes, and infrastructure as code
- Compares rolling, blue-green, and canary deployment strategies with risk levels
- Ships templates for GitHub Actions, Dockerfile, Helm, Terraform, and ArgoCD
Devops Deployment by the numbers
- 1 all-time installs (skills.sh)
- Ranked #1,172 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
devops-deployment capabilities & compatibility
Free; no API keys required in the skill itself.
- Capabilities
- ci cd pipeline · containerization · kubernetes deploy · infrastructure as code · gitops
- Works with
- github · docker · kubernetes · terraform · aws
- Use cases
- devops · ci cd
- Runs
- Runs locally
- Pricing
- Free
What devops-deployment says it does
CI/CD pipelines, containerization, Kubernetes, and infrastructure as code patterns
Comprehensive frameworks for CI/CD pipelines, containerization, deployment strategies, and infrastructure automation.
npx skills add https://github.com/aiskillstore/marketplace --skill devops-deploymentAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 404 |
| Last updated | August 5, 2026 |
| Repository | aiskillstore/marketplace ↗ |
What it does
Set up CI/CD pipelines, containers, Kubernetes, and infrastructure as code for deployment.
When should I use this skill?
When setting up CI/CD pipelines, containerizing applications, or deploying to Kubernetes or cloud platforms.
What you get
Pipeline, container, Kubernetes, and IaC configurations plus a deployment checklist.
- CI/CD pipeline config
- Dockerfile
- Kubernetes manifests
By the numbers
- 6-stage CI/CD pipeline
- 3 deployment strategies compared
- 8 templates referenced
Files
DevOps & Deployment Skill
Comprehensive frameworks for CI/CD pipelines, containerization, deployment strategies, and infrastructure automation.
When to Use
- Setting up CI/CD pipelines
- Containerizing applications
- Deploying to Kubernetes or cloud platforms
- Implementing GitOps workflows
- Managing infrastructure as code
- Planning release strategies
Pipeline Architecture
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Code │──▶│ Build │──▶│ Test │──▶│ Deploy │
│ Commit │ │ & Lint │ │ & Scan │ │ & Release │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
│ │ │ │
▼ ▼ ▼ ▼
Triggers Artifacts Reports MonitoringKey Concepts
CI/CD Pipeline Stages
1. Lint & Type Check - Code quality gates 2. Unit Tests - Test coverage with reporting 3. Security Scan - npm audit + Trivy vulnerability scanner 4. Build & Push - Docker image to container registry 5. Deploy Staging - Environment-gated deployment 6. Deploy Production - Manual approval or automated
See templates/github-actions-pipeline.yml for complete GitHub Actions workflowContainer Best Practices
Multi-stage builds minimize image size:
- Stage 1: Install production dependencies only
- Stage 2: Build application with dev dependencies
- Stage 3: Production runtime with minimal footprint
Security hardening:
- Non-root user (uid 1001)
- Read-only filesystem where possible
- Health checks for orchestrator integration
Seetemplates/Dockerfileandtemplates/docker-compose.yml
Kubernetes Deployment
Essential manifests:
- Deployment with rolling update strategy
- Service for internal routing
- Ingress for external access with TLS
- HorizontalPodAutoscaler for scaling
Security context:
runAsNonRoot: trueallowPrivilegeEscalation: falsereadOnlyRootFilesystem: true- Drop all capabilities
Resource management:
- Always set requests and limits
- Use
requestsfor scheduling,limitsfor throttling
Seetemplates/k8s-manifests.yamlandtemplates/helm-values.yaml
Deployment Strategies
| Strategy | Use Case | Risk |
|---|---|---|
| Rolling | Default, gradual replacement | Low - automatic rollback |
| Blue-Green | Instant switch, easy rollback | Medium - double resources |
| Canary | Progressive traffic shift | Low - gradual exposure |
Rolling Update (Kubernetes default):
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 0 # Zero downtimeBlue-Green: Deploy to standby environment, switch service selector Canary: Use Istio VirtualService for traffic splitting (10% → 50% → 100%)
Infrastructure as Code
Terraform patterns:
- Remote state in S3 with DynamoDB locking
- Module-based architecture (VPC, EKS, RDS)
- Environment-specific tfvars files
See templates/terraform-aws.tf for AWS VPC + EKS + RDS exampleGitOps with ArgoCD
ArgoCD watches Git repository and syncs cluster state:
- Automated sync with pruning
- Self-healing (drift detection)
- Retry policies for transient failures
See templates/argocd-application.yamlSecrets Management
Use External Secrets Operator to sync from cloud providers:
- AWS Secrets Manager
- HashiCorp Vault
- Azure Key Vault
- GCP Secret Manager
See templates/external-secrets.yamlDeployment Checklist
Pre-Deployment
- [ ] All tests passing in CI
- [ ] Security scans clean
- [ ] Database migrations ready
- [ ] Rollback plan documented
During Deployment
- [ ] Monitor deployment progress
- [ ] Watch error rates
- [ ] Verify health checks passing
Post-Deployment
- [ ] Verify metrics normal
- [ ] Check logs for errors
- [ ] Update status page
Helm Chart Structure
charts/app/
├── Chart.yaml
├── values.yaml
├── templates/
│ ├── deployment.yaml
│ ├── service.yaml
│ ├── ingress.yaml
│ ├── configmap.yaml
│ ├── secret.yaml
│ ├── hpa.yaml
│ └── _helpers.tpl
└── values/
├── staging.yaml
└── production.yamlExtended Thinking Triggers
Use Opus 4.5 extended thinking for:
- Architecture decisions - Kubernetes vs serverless, multi-region setup
- Migration planning - Moving between cloud providers
- Incident response - Complex deployment failures
- Security design - Zero-trust architecture
Templates Reference
| Template | Purpose |
|---|---|
github-actions-pipeline.yml | Full CI/CD workflow with 6 stages |
Dockerfile | Multi-stage Node.js build |
docker-compose.yml | Development environment |
k8s-manifests.yaml | Deployment, Service, Ingress |
helm-values.yaml | Helm chart values |
terraform-aws.tf | VPC, EKS, RDS infrastructure |
argocd-application.yaml | GitOps application |
external-secrets.yaml | Secrets Manager integration |
{
"schema_version": "2.0",
"meta": {
"generated_at": "2026-01-16T16:34:12.475Z",
"slug": "ariegoldkin-devops-deployment",
"source_url": "https://github.com/ArieGoldkin/ai-agent-hub/tree/main/skills/devops-deployment",
"source_ref": "main",
"model": "claude",
"analysis_version": "3.0.0",
"source_type": "community",
"content_hash": "ebce5b920943752d96321a370c126c4c7ca7b3ec522b446ce7636689e593c63d",
"tree_hash": "03b53b73f4a6bbaf77e67a9e8e911648d8bcb8c4a052fd92035eaee3c99a9f1a"
},
"skill": {
"name": "devops-deployment",
"description": "CI/CD pipelines, containerization, Kubernetes, and infrastructure as code patterns",
"summary": "CI/CD pipelines, containerization, Kubernetes, and infrastructure as code patterns",
"icon": "🚀",
"version": "1.0.0",
"author": "ArieGoldkin",
"license": "MIT",
"category": "Infrastructure & Deployment",
"tags": [
"CI/CD",
"deployment",
"Docker",
"Kubernetes",
"pipeline",
"infrastructure",
"GitOps",
"container",
"automation",
"release"
],
"supported_tools": [
"claude",
"codex",
"claude-code"
],
"risk_factors": [
"network",
"external_commands",
"env_access"
]
},
"security_audit": {
"risk_level": "safe",
"is_blocked": false,
"safe_to_publish": true,
"summary": "This skill contains only declarative YAML and Terraform configuration templates for DevOps workflows. The static scanner flagged 66 potential issues, but ALL are false positives. The scanner misidentified markdown code formatting as shell execution, template placeholders as hardcoded secrets, and standard DevOps practices as security risks. Templates use proper security patterns including Kubernetes secrets references and GitHub Actions secrets injection.",
"risk_factor_evidence": [
{
"factor": "network",
"evidence": [
{
"file": "skill-report.json",
"line_start": 6,
"line_end": 6
},
{
"file": "templates/argocd-application.yaml",
"line_start": 10,
"line_end": 10
},
{
"file": "templates/argocd-application.yaml",
"line_start": 14,
"line_end": 14
},
{
"file": "templates/Dockerfile",
"line_start": 48,
"line_end": 48
},
{
"file": "templates/terraform-aws.tf",
"line_start": 27,
"line_end": 27
},
{
"file": "templates/terraform-aws.tf",
"line_start": 30,
"line_end": 30
},
{
"file": "templates/terraform-aws.tf",
"line_start": 30,
"line_end": 30
},
{
"file": "templates/terraform-aws.tf",
"line_start": 30,
"line_end": 30
},
{
"file": "templates/terraform-aws.tf",
"line_start": 31,
"line_end": 31
},
{
"file": "templates/terraform-aws.tf",
"line_start": 31,
"line_end": 31
},
{
"file": "templates/terraform-aws.tf",
"line_start": 31,
"line_end": 31
}
]
},
{
"factor": "external_commands",
"evidence": [
{
"file": "SKILL.md",
"line_start": 25,
"line_end": 33
},
{
"file": "SKILL.md",
"line_start": 33,
"line_end": 46
},
{
"file": "SKILL.md",
"line_start": 46,
"line_end": 60
},
{
"file": "SKILL.md",
"line_start": 60,
"line_end": 60
},
{
"file": "SKILL.md",
"line_start": 60,
"line_end": 71
},
{
"file": "SKILL.md",
"line_start": 71,
"line_end": 72
},
{
"file": "SKILL.md",
"line_start": 72,
"line_end": 73
},
{
"file": "SKILL.md",
"line_start": 73,
"line_end": 78
},
{
"file": "SKILL.md",
"line_start": 78,
"line_end": 78
},
{
"file": "SKILL.md",
"line_start": 78,
"line_end": 80
},
{
"file": "SKILL.md",
"line_start": 80,
"line_end": 80
},
{
"file": "SKILL.md",
"line_start": 80,
"line_end": 91
},
{
"file": "SKILL.md",
"line_start": 91,
"line_end": 97
},
{
"file": "SKILL.md",
"line_start": 97,
"line_end": 109
},
{
"file": "SKILL.md",
"line_start": 109,
"line_end": 118
},
{
"file": "SKILL.md",
"line_start": 118,
"line_end": 128
},
{
"file": "SKILL.md",
"line_start": 128,
"line_end": 150
},
{
"file": "SKILL.md",
"line_start": 150,
"line_end": 165
},
{
"file": "SKILL.md",
"line_start": 165,
"line_end": 179
},
{
"file": "SKILL.md",
"line_start": 179,
"line_end": 180
},
{
"file": "SKILL.md",
"line_start": 180,
"line_end": 181
},
{
"file": "SKILL.md",
"line_start": 181,
"line_end": 182
},
{
"file": "SKILL.md",
"line_start": 182,
"line_end": 183
},
{
"file": "SKILL.md",
"line_start": 183,
"line_end": 184
},
{
"file": "SKILL.md",
"line_start": 184,
"line_end": 185
},
{
"file": "SKILL.md",
"line_start": 185,
"line_end": 186
}
]
},
{
"factor": "env_access",
"evidence": [
{
"file": "templates/docker-compose.yml",
"line_start": 16,
"line_end": 16
},
{
"file": "templates/docker-compose.yml",
"line_start": 17,
"line_end": 17
},
{
"file": "templates/github-actions-pipeline.yml",
"line_start": 99,
"line_end": 99
},
{
"file": "templates/k8s-manifests.yaml",
"line_start": 39,
"line_end": 39
}
]
}
],
"critical_findings": [],
"high_findings": [],
"medium_findings": [],
"low_findings": [],
"dangerous_patterns": [],
"files_scanned": 10,
"total_lines": 953,
"audit_model": "claude",
"audited_at": "2026-01-16T16:34:12.475Z"
},
"content": {
"user_title": "Deploy applications with CI/CD pipelines and IaC templates",
"value_statement": "Setting up deployment infrastructure from scratch is complex and error-prone. This skill provides production-ready templates for Docker, Kubernetes, Terraform, and GitHub Actions workflows that you can customize for your environment.",
"seo_keywords": [
"DevOps deployment",
"CI/CD pipeline template",
"Docker container build",
"Kubernetes deployment",
"Terraform AWS infrastructure",
"GitHub Actions workflow",
"ArgoCD GitOps",
"Claude Code",
"Claude",
"Codex"
],
"actual_capabilities": [
"Generate multi-stage Dockerfiles with security hardening",
"Create Kubernetes manifests with rolling updates and resource limits",
"Build GitHub Actions CI/CD pipelines with 6 stages",
"Configure Terraform modules for AWS VPC, EKS, and RDS",
"Set up ArgoCD applications for GitOps workflows",
"Implement External Secrets with AWS Secrets Manager integration"
],
"limitations": [
"Templates contain placeholders that you must replace with your values",
"Templates are starting points that need customization for your environment",
"Does not execute deployments or interact with live infrastructure directly"
],
"use_cases": [
{
"target_user": "DevOps Engineers",
"title": "Set up CI/CD pipelines",
"description": "Generate complete GitHub Actions workflows with lint, test, security scan, build, and deploy stages"
},
{
"target_user": "Backend Developers",
"title": "Containerize applications",
"description": "Create production-ready Dockerfiles and Kubernetes manifests with security best practices"
},
{
"target_user": "Platform Architects",
"title": "Define infrastructure as code",
"description": "Configure Terraform modules for AWS cloud resources including VPC, EKS clusters, and RDS databases"
}
],
"prompt_templates": [
{
"title": "K8s deployment",
"scenario": "Create Kubernetes manifests for Node.js app",
"prompt": "Create Kubernetes deployment, service, and ingress manifests for a Node.js application. Include rolling update strategy, security context with non-root user, resource requests and limits, and health checks on port 3000."
},
{
"title": "Dockerfile",
"scenario": "Build production container image",
"prompt": "Create a multi-stage Dockerfile for a Node.js application using node:20-alpine base. Install production dependencies only in final stage, create non-root user with uid 1001, and include a health check endpoint."
},
{
"title": "GitHub Actions",
"scenario": "Build CI/CD pipeline",
"prompt": "Create a GitHub Actions workflow with lint, test, security scan, build, and deploy stages. Include npm audit, Trivy vulnerability scanning, Docker buildx with cache, and environment-gated deployment to staging and production."
},
{
"title": "Terraform AWS",
"scenario": "Provision cloud infrastructure",
"prompt": "Create Terraform configuration for AWS infrastructure including VPC with public and private subnets, EKS cluster with managed node groups, and RDS PostgreSQL instance with encryption and backup retention."
}
],
"output_examples": [
{
"input": "Create a Kubernetes deployment for a Node.js API with 3 replicas, rolling updates, and proper security settings",
"output": [
"Deployment with 3 replicas and rolling update strategy (maxSurge: 1, maxUnavailable: 0)",
"Security context: runAsNonRoot: true, runAsUser: 1001, allowPrivilegeEscalation: false",
"Resource limits: cpu 500m, memory 512Mi, requests: cpu 100m, memory 128Mi",
"Health checks: liveness probe on /health, readiness probe on /ready",
"Service type ClusterIP routing to port 3000",
"Ingress with nginx controller and TLS via cert-manager"
]
},
{
"input": "Create a GitHub Actions workflow for a Node.js project with security scanning",
"output": [
"Lint stage with npm run lint and typecheck",
"Test stage with coverage reporting to Codecov",
"Security stage with npm audit and Trivy vulnerability scanner",
"Build stage with Docker buildx and GitHub container registry push",
"Deploy staging with environment protection rules",
"Deploy production with manual approval gate"
]
}
],
"best_practices": [
"Always review and customize template placeholders like image names, domains, and environment variables before use",
"Use External Secrets Operator or similar tools instead of embedding secrets in manifests",
"Test deployments in staging environment with the same configuration before production rollout"
],
"anti_patterns": [
"Using latest image tag in production instead of pinned versions",
"Running containers as root user in Kubernetes pods",
"Skipping security scanning stages in CI/CD pipelines"
],
"faq": [
{
"question": "Which CI/CD platforms are supported?",
"answer": "Templates use GitHub Actions as primary example. Patterns apply to GitLab CI, CircleCI, and other platforms with minimal changes."
},
{
"question": "Can I customize the deployment strategies?",
"answer": "Yes. Templates include rolling updates by default. You can modify to blue-green or canary by adjusting the strategy."
},
{
"question": "Does this skill scan for vulnerabilities?",
"answer": "GitHub Actions template includes npm audit and Trivy scanner. You can add Snyk, CodeQL, or other security tools."
},
{
"question": "How are secrets managed securely?",
"answer": "Use External Secrets Operator template to sync from AWS Secrets Manager, HashiCorp Vault, or Azure Key Vault."
},
{
"question": "What if deployments fail?",
"answer": "ArgoCD templates include self-healing and retry policies. GitHub Actions templates support environment protection rules."
},
{
"question": "How is this different from other tools?",
"answer": "This skill provides copy-paste ready templates that you own and control. Customize every aspect for your requirements."
}
]
},
"file_structure": [
{
"name": "templates",
"type": "dir",
"path": "templates",
"children": [
{
"name": "argocd-application.yaml",
"type": "file",
"path": "templates/argocd-application.yaml",
"lines": 28
},
{
"name": "docker-compose.yml",
"type": "file",
"path": "templates/docker-compose.yml",
"lines": 50
},
{
"name": "Dockerfile",
"type": "file",
"path": "templates/Dockerfile",
"lines": 52
},
{
"name": "external-secrets.yaml",
"type": "file",
"path": "templates/external-secrets.yaml",
"lines": 23
},
{
"name": "github-actions-pipeline.yml",
"type": "file",
"path": "templates/github-actions-pipeline.yml",
"lines": 141
},
{
"name": "helm-values.yaml",
"type": "file",
"path": "templates/helm-values.yaml",
"lines": 45
},
{
"name": "k8s-manifests.yaml",
"type": "file",
"path": "templates/k8s-manifests.yaml",
"lines": 105
},
{
"name": "terraform-aws.tf",
"type": "file",
"path": "templates/terraform-aws.tf",
"lines": 92
}
]
},
{
"name": "SKILL.md",
"type": "file",
"path": "SKILL.md",
"lines": 187
}
]
}
# ArgoCD Application for GitOps deployment
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/org/app-config.git
targetRevision: HEAD
path: k8s/overlays/production
destination:
server: https://kubernetes.default.svc
namespace: app
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
# Development environment with app, database, and cache
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://postgres:postgres@db:5432/app
- REDIS_URL=redis://redis:6379
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: app
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
volumes:
postgres_data:
redis_data:
# Multi-stage build for Node.js application
# Stage 1: Dependencies
FROM node:20-alpine AS deps
WORKDIR /app
# Copy package files
COPY package.json package-lock.json ./
# Install dependencies (production only)
RUN npm ci --only=production
# Stage 2: Build
FROM node:20-alpine AS builder
WORKDIR /app
# Copy all package files
COPY package.json package-lock.json ./
RUN npm ci
# Copy source code
COPY . .
# Build application
RUN npm run build
# Stage 3: Production
FROM node:20-alpine AS runner
WORKDIR /app
# Create non-root user
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 appuser
# Copy built artifacts
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json ./
# Set ownership
RUN chown -R appuser:nodejs /app
USER appuser
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
# Start application
CMD ["node", "dist/main.js"]
# External Secrets Operator with AWS Secrets Manager
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: app-secrets
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secrets-manager
kind: ClusterSecretStore
target:
name: app-secrets
creationPolicy: Owner
data:
- secretKey: database-url
remoteRef:
key: app/production/database
property: url
- secretKey: api-key
remoteRef:
key: app/production/api
property: key
# CI/CD Pipeline - GitHub Actions
# Full pipeline with lint, test, security scan, build, and deploy stages
name: CI/CD Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
NODE_VERSION: '20'
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
# Stage 1: Lint and Type Check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Run type check
run: npm run typecheck
# Stage 2: Unit Tests
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test -- --coverage
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
# Stage 3: Security Scan
security:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Run npm audit
run: npm audit --audit-level=high
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
severity: 'CRITICAL,HIGH'
# Stage 4: Build and Push Docker Image
build:
runs-on: ubuntu-latest
needs: [test, security]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=
type=ref,event=branch
type=semver,pattern={{version}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Stage 5: Deploy to Staging
deploy-staging:
runs-on: ubuntu-latest
needs: build
environment: staging
steps:
- name: Deploy to staging
run: |
# Deploy using kubectl, helm, or cloud CLI
echo "Deploying to staging..."
# Stage 6: Deploy to Production
deploy-production:
runs-on: ubuntu-latest
needs: deploy-staging
environment: production
steps:
- name: Deploy to production
run: |
echo "Deploying to production..."
# Helm Chart values.yaml
# Application deployment configuration
replicaCount: 3
image:
repository: ghcr.io/org/app
tag: latest
pullPolicy: Always
service:
type: ClusterIP
port: 80
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- host: app.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: app-tls
hosts:
- app.example.com
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 70
# Environment-specific values in values/staging.yaml and values/production.yaml
# Kubernetes Deployment, Service, and Ingress
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: app
labels:
app: app
spec:
replicas: 3
selector:
matchLabels:
app: app
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: app
spec:
serviceAccountName: app
securityContext:
runAsNonRoot: true
runAsUser: 1001
fsGroup: 1001
containers:
- name: app
image: ghcr.io/org/app:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
protocol: TCP
env:
- name: NODE_ENV
value: "production"
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: app-secrets
key: database-url
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "512Mi"
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 3000
initialDelaySeconds: 5
periodSeconds: 5
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
---
apiVersion: v1
kind: Service
metadata:
name: app
spec:
selector:
app: app
ports:
- port: 80
targetPort: 3000
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
tls:
- hosts:
- app.example.com
secretName: app-tls
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: app
port:
number: 80
# AWS Infrastructure with Terraform
# VPC, EKS, and RDS configuration
terraform {
required_version = ">= 1.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "terraform-state"
key = "app/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-locks"
}
}
# VPC
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.0.0"
name = "app-vpc"
cidr = "10.0.0.0/16"
azs = ["us-east-1a", "us-east-1b", "us-east-1c"]
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
enable_nat_gateway = true
single_nat_gateway = true
tags = {
Environment = var.environment
Project = "app"
}
}
# EKS Cluster
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "19.0.0"
cluster_name = "app-cluster"
cluster_version = "1.28"
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
eks_managed_node_groups = {
main = {
min_size = 2
max_size = 10
desired_size = 3
instance_types = ["t3.medium"]
capacity_type = "ON_DEMAND"
}
}
}
# RDS Database
module "rds" {
source = "terraform-aws-modules/rds/aws"
version = "6.0.0"
identifier = "app-db"
engine = "postgres"
engine_version = "16.1"
family = "postgres16"
major_engine_version = "16"
instance_class = "db.t3.medium"
allocated_storage = 20
max_allocated_storage = 100
db_name = "app"
username = "app"
port = 5432
vpc_security_group_ids = [module.security_group.security_group_id]
subnet_ids = module.vpc.database_subnets
backup_retention_period = 7
skip_final_snapshot = false
deletion_protection = true
}
Related skills
FAQ
Which deployment strategies does it cover?
Rolling, blue-green, and canary, each with its use case and risk level.
What tools do the templates target?
GitHub Actions, Docker, Kubernetes, Helm, Terraform for AWS, and ArgoCD.