Deploy applications to Vercel with optimized CI/CD pipelines, preview deployments, and production rollbacks.
Before deploying, ensure:
vercel.json or vercel.ts configvercel build)# Preview deployment (creates unique URL)
vercel
# Production deployment
vercel --prod
# Deploy specific directory
vercel ./path/to/project
# With environment variables
vercel --env NODE_ENV=production
For automated deployments:
main or master)# Pull environment variables from Vercel
vercel env pull .env.local
# Add environment variable
vercel env add NEXT_PUBLIC_API_URL
# List environment variables
vercel env list
# View deployment logs
vercel logs my-project
# Check deployment status
vercel ls
# List recent deployments
vercel ls
# Rollback to previous deployment
vercel rollback [deployment-url]
vercel.json to configure build commandsrewrites for API routingheaders for cachingcrons for scheduled tasks| Issue | Solution |
|---|---|
| Build fails | Check build command in vercel.json |
| 404 on routes | Configure rewrites in vercel.json |
| Environment variables missing | Run vercel env pull |
| Timeout errors | Increase maxDuration in config |