Deployment
How I deploy every project. Vercel + GitHub is my default setup.
Vercel Setup
- Push to GitHub
- Import repo at vercel.com/new
- Framework preset auto-detects Next.js
- Set environment variables
- Deploy
That's it for most projects. Zero config needed.
Environment Variables
# .env.local (never commit this)
DATABASE_URL="postgresql://..."
NEXTAUTH_SECRET="your-secret"
GEMINI_API_KEY="your-key"
# Prefix with NEXT_PUBLIC_ to expose to browser
NEXT_PUBLIC_APP_URL="https://yourapp.com"
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="yourcloud"
Rules:
NEXT_PUBLIC_*is bundled into client JS, visible to everyone- Everything else is server-only, never exposed to the browser
- Use Vercel environment variables for production secrets, never
.env.localin the repo
CI/CD via GitHub
Every push to main triggers a production deployment automatically. Every PR gets a preview URL.
main branch → production deploy (wayan-phantom.vercel.app)
feature branch → preview deploy (wayan-phantom-git-feature.vercel.app)
Push env vars via Vercel CLI:
echo "your-value" | npx vercel env add VARIABLE_NAME production
Custom Domain
In Vercel dashboard: Settings > Domains > Add. Point your DNS CNAME to cname.vercel-dns.com. SSL is automatic.
Build Optimization Checklist
- Remove
console.login production code - Set proper
Cache-Controlheaders on API routes - Use
next/imagefor all images - Enable Vercel Analytics for performance monitoring
- Set up error tracking (Sentry or Vercel's built-in)
Last updated: September 2026.