Deploy
by @ivangdavila
Ship applications reliably with CI/CD, rollback strategies, and zero-downtime deployment patterns.
clawhub install deploy
π About This Skill
name: Deploy
description: Ship applications reliably with CI/CD, rollback strategies, and zero-downtime deployment patterns.
metadata: {"clawdbot":{"emoji":"π","os":["linux","darwin","win32"]}}
Deployment Rules
Pre-Deploy Checklist
Tests passing in CI β never deploy with failing tests
Environment variables set in target β missing secrets cause silent failures
Database migrations run before code deploy β new code expecting new schema fails
Rollback plan ready β know exactly how to revert before you need toDeployment Strategies
Rolling: update instances one by one β safe, slower, no extra resources
Blue-green: full parallel environment, instant switch β fast rollback, 2x resources
Canary: route percentage to new version β catch issues early, complex routing
Choose based on risk tolerance and resources β no universal bestZero-Downtime Deploys
Health checks must pass before traffic routes β unhealthy instances stay out
Graceful shutdown: finish in-flight requests before terminating
Database changes must be backwards compatible β old code still running during deploy
Session handling: sticky sessions or external session store β don't lose user stateCI/CD Pipeline
Build once, deploy everywhere β same artifact to staging and prod
Cache dependencies between builds β save minutes per deploy
Parallel steps where possible β tests, linting, security scans
Fail fast: quick checks first β don't wait for slow tests to catch typos
Pin action versions with SHA β tags can change unexpectedlyEnvironment Management
Staging mirrors prod β different configs cause "works in staging" bugs
Secrets in secret manager, not environment files β rotation without redeploy
Feature flags decouple deploy from release β ship dark, enable later
Config as code in version control β except secretsDatabase Migrations
Migrations must be backwards compatible during deploy window
Add columns nullable first, then backfill, then add constraint
Never rename columns in one step β add new, migrate data, remove old
Test migrations on prod-size data β 10 rows is fast, 10 million isn't
Rollback script for every migrationRollback
Automated rollback on health check failure
Keep previous version artifacts available β can't rollback what you deleted
Database rollbacks are hard β design migrations to not need them
Feature flags for instant rollback of functionality without deploy
Document rollback procedure β panic time is not learning timeMonitoring Post-Deploy
Watch error rates for 15 minutes after deploy β most issues surface quickly
Compare key metrics to pre-deploy baseline
Alerting on anomalies: latency spike, error rate increase
Log correlation: trace requests through systems
User-facing smoke tests after deployPlatform-Specific
Containers
Image tagged with git SHA β know exactly what's running
Health check endpoint that verifies dependencies
Resource limits set β prevent runaway containersServerless
Cold start optimization β keep bundles small
Provisioned concurrency for latency-sensitive paths
Timeout set appropriately β default is often too shortStatic Sites
CDN cache invalidation after deploy
Immutable assets with content hashes β cache forever
Preview deploys for PRsCommon Mistakes
Deploying Friday afternoon β issues surface when nobody's watching
No rollback plan β hoping nothing goes wrong isn't a strategy
Mixing code and migration deploys β one thing at a time
Manual deploy steps β if it's not automated, it's wrong sometimes
Deploying without monitoring β you won't know it's broken until users complain