BACK TO DIRECTORY
commandintermediate
/deploy
A deployment command that handles the full deployment lifecycle. Validates environment variables, runs pre-deployment checks (lint, type-check, tests), builds the application, deploys to the configured platform, runs post-deployment health checks, and provides rollback instructions if something goes wrong. Supports Vercel and Cloudflare Pages.
567 STARS
7.9k DOWNLOADS
claude-templates
deployvercelcloudflareci-cdproduction
CONFIGURATION
markdown
1# /deploy Command23## Description4Deploy the application to production with safety checks.56## Steps78### 1. Pre-deployment Checks9```bash10# Ensure working directory is clean11git status --porcelain | grep -q . && echo "ERROR: Uncommitted changes" && exit 11213# Run quality checks14pnpm run lint15pnpm run type-check16pnpm run test -- --run1718# Verify environment variables19test -z "$VERCEL_TOKEN" && echo "ERROR: VERCEL_TOKEN not set" && exit 120```2122### 2. Build23```bash24pnpm run build25```2627### 3. Deploy28```bash29# Vercel deployment30vercel --prod --yes3132# Or Cloudflare Pages33# npx wrangler pages deploy .next --project-name=my-app34```3536### 4. Post-deployment37```bash38# Health check39curl -f https://my-app.vercel.app/api/health || echo "WARN: Health check failed"4041# Notify team42echo "Deployed successfully at $(date)"43```4445### 5. Rollback (if needed)46```bash47# List recent deployments48vercel ls --limit 54950# Rollback to previous51vercel rollback52```5354## Usage55Type `/deploy` in Claude Code to trigger the full deployment pipeline.56Pass `--preview` for a preview deployment instead of production.