Vercel deployment using Vercel CLI for Next.js, React, Vue, static sites, and serverless functions. Includes project validation, deployment orchestration, environment management, domain configuration, and analytics integration. Use when deploying frontend applications, static sites, or serverless APIs, or when user mentions Vercel, Next.js deployment, serverless functions, or edge network.
Limited to specific tools
Additional assets for this skill
This skill is limited to using the following tools:
README.mdscripts/deploy-to-vercel.shscripts/validate-app.shtemplates/vercel-nextjs.jsontemplates/vercel-react.jsontemplates/vercel-static.jsonThis skill provides comprehensive deployment lifecycle management for applications deployed to Vercel using the Vercel CLI.
The deployment lifecycle consists of five phases:
Script: scripts/validate-app.sh <app-path>
Purpose: Validates application is ready for Vercel deployment
Checks:
Usage:
# Validate Next.js app
./scripts/validate-app.sh /path/to/nextjs-app
# Validate React app
./scripts/validate-app.sh /path/to/react-app
# Validate static site
STATIC_SITE=true ./scripts/validate-app.sh /path/to/static-site
# Verbose mode
VERBOSE=1 ./scripts/validate-app.sh .
Exit Codes:
0: Validation passed1: Validation failed (must fix before deployment)Script: scripts/deploy-to-vercel.sh <app-path> [environment]
Purpose: Deploys application to Vercel
Actions:
Usage:
# Deploy to preview (automatic for branches)
./scripts/deploy-to-vercel.sh /path/to/app
# Deploy to production
./scripts/deploy-to-vercel.sh /path/to/app production
# Deploy with custom name
PROJECT_NAME=my-app ./scripts/deploy-to-vercel.sh /path/to/app
# Deploy and wait for completion
WAIT=true ./scripts/deploy-to-vercel.sh /path/to/app production
# Deploy with specific build command
BUILD_CMD="npm run build:prod" ./scripts/deploy-to-vercel.sh /path/to/app
Environment Variables:
VERCEL_TOKEN: Vercel authentication tokenVERCEL_ORG_ID: Organization ID (for team projects)VERCEL_PROJECT_ID: Project ID (for existing projects)PROJECT_NAME: Custom project nameBUILD_CMD: Custom build commandOUTPUT_DIR: Custom output directoryWAIT: Set to true to wait for deployment completionPROD: Set to true for production deploymentExit Codes:
0: Deployment successful1: Deployment failedScript: scripts/update-env-vars.sh <project-name> <environment>
Purpose: Updates environment variables for Vercel project
Actions:
Usage:
# Update production env vars
./scripts/update-env-vars.sh my-app production
# Update from .env file
ENV_FILE=.env.production ./scripts/update-env-vars.sh my-app production
# Update specific variables
API_KEY=new_key DATABASE_URL=new_url ./scripts/update-env-vars.sh my-app production
# Update for all environments
ENV_SCOPE=all ./scripts/update-env-vars.sh my-app
Exit Codes:
0: Environment variables updated successfully1: Update failedScript: scripts/configure-domain.sh <project-name> <domain>
Purpose: Configures custom domain for Vercel project
Actions:
Usage:
# Add custom domain
./scripts/configure-domain.sh my-app myapp.com
# Add with www redirect
WWW_REDIRECT=true ./scripts/configure-domain.sh my-app myapp.com
# Add subdomain
./scripts/configure-domain.sh my-app api.myapp.com
# Force HTTPS redirect
FORCE_HTTPS=true ./scripts/configure-domain.sh my-app myapp.com
Exit Codes:
0: Domain configured successfully1: Configuration failedScript: scripts/manage-deployment.sh <action> <project-name>
Purpose: Manage Vercel deployments and project
Actions:
list: List recent deploymentsinspect: Show deployment detailslogs: View deployment logsrollback: Rollback to previous deploymentpromote: Promote preview to productionremove: Remove deploymentalias: Manage aliasesUsage:
# List deployments
./scripts/manage-deployment.sh list my-app
# Inspect specific deployment
./scripts/manage-deployment.sh inspect my-app <deployment-url>
# View logs
./scripts/manage-deployment.sh logs my-app <deployment-url>
# Rollback to previous
./scripts/manage-deployment.sh rollback my-app
# Promote preview to production
./scripts/manage-deployment.sh promote my-app <preview-url>
# Remove deployment
./scripts/manage-deployment.sh remove my-app <deployment-url>
Script: scripts/health-check.sh <deployment-url>
Purpose: Validates Vercel deployment health
Checks:
Usage:
# Check deployment health
./scripts/health-check.sh https://my-app.vercel.app
# Continuous monitoring (runs every 30s)
MONITOR=true ./scripts/health-check.sh https://my-app.vercel.app
# Detailed health report
DETAILED=true ./scripts/health-check.sh https://my-app.vercel.app
Exit Codes:
0: All health checks passed1: One or more health checks failedScript: scripts/setup-project.sh <app-path> <project-name>
Purpose: Initialize Vercel project configuration
Actions:
Usage:
# Setup new project
./scripts/setup-project.sh /path/to/app my-app
# Setup with custom settings
FRAMEWORK=nextjs ./scripts/setup-project.sh /path/to/app my-app
# Setup for team
TEAM=my-team ./scripts/setup-project.sh /path/to/app my-app
File: templates/vercel-nextjs.json
Purpose: vercel.json for Next.js applications
Example:
{
"version": 2,
"framework": "nextjs",
"buildCommand": "npm run build",
"outputDirectory": ".next",
"installCommand": "npm install",
"devCommand": "npm run dev",
"env": {
"NEXT_PUBLIC_API_URL": "your_api_url_here"
},
"build": {
"env": {
"DATABASE_URL": "@database-url"
}
}
}
File: templates/vercel-react.json
Purpose: vercel.json for React applications
Example:
{
"version": 2,
"buildCommand": "npm run build",
"outputDirectory": "dist",
"installCommand": "npm install",
"devCommand": "npm run dev",
"framework": "vite",
"routes": [
{
"src": "/api/(.*)",
"dest": "/api/$1"
},
{
"src": "/(.*)",
"dest": "/index.html"
}
]
}
File: templates/vercel-static.json
Purpose: vercel.json for static sites
Example:
{
"version": 2,
"buildCommand": "npm run build",
"outputDirectory": "public",
"routes": [
{
"src": "/(.*)",
"dest": "/$1"
}
],
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
]
}
File: templates/vercel-serverless.json
Purpose: vercel.json for serverless API
Example:
{
"version": 2,
"functions": {
"api/**/*.js": {
"runtime": "nodejs18.x",
"memory": 1024,
"maxDuration": 10
}
},
"rewrites": [
{
"source": "/api/(.*)",
"destination": "/api/$1"
}
]
}
File: templates/.env.example
Purpose: Environment variable template
Example:
# Public variables (exposed to browser)
NEXT_PUBLIC_API_URL=your_api_url_here
NEXT_PUBLIC_ANALYTICS_ID=your_analytics_id_here
# Server-only variables (not exposed)
DATABASE_URL=your_database_url_here
API_SECRET=your_api_secret_here
STRIPE_SECRET_KEY=your_stripe_key_here
# Vercel system variables (automatically provided)
# VERCEL=1
# VERCEL_URL=<deployment-url>
# VERCEL_ENV=production|preview|development
Validate Application:
./scripts/validate-app.sh /path/to/app
Setup Project:
./scripts/setup-project.sh /path/to/app my-app
Deploy to Preview:
./scripts/deploy-to-vercel.sh /path/to/app
Verify Deployment:
./scripts/health-check.sh https://my-app-preview.vercel.app
Deploy to Production:
./scripts/deploy-to-vercel.sh /path/to/app production
Deploy Updates:
./scripts/deploy-to-vercel.sh /path/to/app production
Verify Health:
./scripts/health-check.sh https://my-app.com
Update Variables:
./scripts/update-env-vars.sh my-app production
Redeploy (automatic after env var changes)
Add Domain:
./scripts/configure-domain.sh my-app myapp.com
Update DNS (follow Vercel instructions)
Verify Domain:
./scripts/health-check.sh https://myapp.com
vercel secrets addNEXT_PUBLIC_ for browser-exposed variables| Feature | Vercel | App Platform | Droplets |
|---|---|---|---|
| Framework Focus | Frontend/Fullstack | Any | Any |
| Edge Network | Global | CDN available | Manual |
| Serverless | Built-in | No | Manual |
| Git Integration | Native | Native | Manual |
| Build Time | Fast | Medium | N/A |
| Cost (Small) | Free-$20/mo | $5-12/mo | $4-6/mo |
| Best For | Next.js, React, Vue | Docker apps | Custom servers |
# View build logs
./scripts/manage-deployment.sh logs my-app <deployment-url>
# Common issues:
# - Missing dependencies in package.json
# - Incorrect build command
# - Node.js version mismatch
# - Environment variables missing at build time
# Check deployment status
vercel inspect <deployment-url>
# View runtime logs
vercel logs <deployment-url>
# Common issues:
# - Serverless function timeout
# - Memory limit exceeded
# - Missing environment variables
# - API route errors
# Check domain configuration
vercel domains ls
# Verify DNS
dig myapp.com
# Common issues:
# - DNS not propagated (wait 24-48 hours)
# - Incorrect DNS records
# - SSL certificate provisioning (automatic, wait a few minutes)
This skill integrates with:
/deployment:prepare - Pre-deployment validation/deployment:deploy - Execute Vercel deployment/deployment:validate - Post-deployment verification/deployment:rollback - Rollback to previous deployment# Authentication
vercel login
vercel logout
# Deployment
vercel # Deploy to preview
vercel --prod # Deploy to production
vercel --name my-app # Deploy with custom name
# Project Management
vercel list # List projects
vercel inspect <url> # Inspect deployment
vercel logs <url> # View logs
vercel remove <url> # Remove deployment
# Environment Variables
vercel env ls # List env vars
vercel env add # Add env var
vercel env rm # Remove env var
# Domains
vercel domains ls # List domains
vercel domains add # Add domain
vercel domains rm # Remove domain
# Aliases
vercel alias ls # List aliases
vercel alias set # Set alias
vercel alias rm # Remove alias