deployment-rollback

Rollback failed deployments, restore previous versions, and handle deployment emergencies. Use when deployments fail, critical bugs are discovered in production, performance degrades after deployment, or emergency recovery is needed.

motormetrics/motormetrics64 installsMITSynced Aug 22

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: deployment-rollback
description: Rollback failed deployments, restore previous versions, and handle deployment emergencies. Use when deployments fail, critical bugs are discovered in production, performance degrades after deployment, or emergency recovery is needed.
license: MIT
---

# Deployment Rollback Skill

## Quick Rollback via Vercel

### Using Vercel Dashboard

1. Go to Vercel Dashboard → Project → Deployments
2. Find the previous working deployment
3. Click the three dots menu → "Promote to Production"

### Using Vercel CLI

```bash
# List recent deployments
vercel list

# Promote a specific deployment to production
vercel promote <deployment-url>

# Or rollback to previous production deployment
vercel rollback
```

## Database Rollback

```bash
# Rollback last migration
pnpm -F /database db:rollback

# Rollback to specific migration
pnpm -F /database db:rollback --to 20240115_initial

# Restore from backup
pg_dump $DATABASE_URL > backup-pre-deploy.sql  # Before deploy
psql $DATABASE_URL < backup-pre-deploy.sql     # Restore if needed
```

## Git-Based Rollback

```bash
# Revert specific commit
git revert <commit-hash>
git push origin main  # Triggers Vercel redeploy

# Create rollback branch
git checkout -b rollback/v1.1.0
git reset --hard v1.1.0
git push origin rollback/v1.1.0
gh pr create --title "Rollback to v1.1.0" --body "Emergency rollback"
```

## Cache Invalidation

```bash
# Revalidate Next.js cache
curl -X POST "https://motormetrics.app/api/revalidate?tag=all&secret=$REVALIDATE_TOKEN"

# Clear Redis cache
redis-cli -h $REDIS_HOST FLUSHALL
```

## Health Checks During Rollback

```bash
curl -f https://motormetrics.app || echo "Web unhealthy"
psql $DATABASE_URL -c "SELECT 1" || echo "Database unreachable"
```

## Rollback Checklist

**Pre-Rollback:**
- [ ] Identify issue and severity
- [ ] Determine scope (full/partial)
- [ ] Check backup availability
- [ ] Notify team

**During:**
- [ ] Rollback via Vercel dashboard or CLI
- [ ] Rollback database if needed
- [ ] Clear caches
- [ ] Verify health checks
- [ ] Run smoke tests

**Post:**
- [ ] Monitor error rates in Vercel dashboard
- [ ] Verify functionality restored
- [ ] Document what happened
- [ ] Create postmortem

## Common Scenarios

**Critical Bug:**
```bash
vercel rollback
curl https://motormetrics.app/api/health
```

**Database Migration Failure:**
```bash
pnpm -F /database db:rollback
git revert HEAD
git push origin main
```

## Troubleshooting

**Rollback deployment not working:**
```bash
# Force redeploy from known good commit
git checkout v1.1.0
vercel --prod
```

**Database schema mismatch:**
```bash
pnpm -F /database db:rollback
# Or restore backup: psql $DATABASE_URL < backup-pre-deploy.sql
```

## Best Practices

1. **Always Backup**: Create database backups before major deployments
2. **Test Rollback**: Practice rollback procedures in preview deployments
3. **Feature Flags**: Use for quick feature disabling without rollback
4. **Monitor Closely**: Watch Vercel analytics during and after rollback
5. **Document Everything**: Record what happened and why

## References

- Vercel Rollbacks: https://vercel.com/docs/deployments/rollbacks
- See `monitoring` skill for debugging issues

More Deployment & CI/CD skills

azure-enterprise-infra-planner

microsoft/azure-skills

Architect and provision enterprise Azure infrastructure from workload descriptions. For cloud architects and platform engineers planning networking, identity, security, compliance, and multi-resource topologies with WAF alignment. Generates Bicep or Terraform directly (no azd). WHEN: 'plan Azure infrastructure', 'architect Azure landing zone', 'design hub-spoke network', 'plan multi-region DR topology', 'set up VNets firewalls and private endpoints', 'subscription-scope Bicep deployment', 'Azure Backup for VM workloads'. PREFER azure-prepare FOR app-centric workflows.

387.5k

azure-kubernetes-app-deploy

microsoft/azure-skills

Use when deploying an existing web application or API to an already-running Azure Kubernetes Service cluster. Detects the framework, generates a Dockerfile and Kubernetes manifests, validates against AKS Deployment Safeguards, and deploys with verification. WHEN: deploy app to AKS, deploy to existing AKS cluster, containerize app for Kubernetes, generate K8s manifests for Azure, set up CI/CD for AKS, my AKS deployment is failing safeguard checks, I have a Django/Express/Spring Boot app to run on AKS. DO NOT USE FOR: creating or provisioning an AKS cluster (use azure-kubernetes), assessing migration to AKS Automatic (use azure-kubernetes-automatic-readiness), or deploying to non-AKS targets like Web Apps, Container Apps, or Functions.

380.4k

finetuning

microsoft/azure-skills

Fine-tune models on Microsoft Foundry using SFT (supervised), DPO (preference), or RFT (reinforcement with graders). Covers dataset preparation, training job submission, deployment, and evaluation. USE FOR: fine-tune, SFT, DPO, RFT, training data, grader, distillation, fine-tuned model, training job, large file upload, calibrate grader, deploy fine-tuned model, evaluate fine-tuned model. DO NOT USE FOR: general model deployment without fine-tuning (use deploy-model), agent creation (use agents), prompt optimization without training (use prompt-optimizer).

323.2k

← All Deployment & CI/CD skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY