🚀 Convex + Vercel Automated Deployment Setup
This guide sets up automatic Convex deployment with every Vercel deployment, eliminating the manual npx convex deploy step.
✅ Automated Build Configuration (Already Done)
The vercel.json has been configured with:
{
"buildCommand": "cd apps/homepage-web && npx convex deploy --cmd 'cd ../.. && pnpm turbo build --filter=homepage-web'"
}This ensures that every git push will:
- 🔄 Deploy Convex functions first
- 🏗️ Build the Next.js frontend
- 🚀 Deploy both together
🔑 Required: Vercel Dashboard Setup
You need to configure the CONVEX_DEPLOY_KEY in Vercel dashboard:
1. Get Production Deploy Key
- Go to Convex Dashboard
- Navigate to your project's Settings page
- Click "Generate Production Deploy Key"
- Copy the generated key
2. Set Environment Variable in Vercel
- Go to your Vercel Dashboard
- Select your project
- Go to Settings → Environment Variables
- Add new variable:
- Name:
CONVEX_DEPLOY_KEY - Value: [paste the key from step 1]
- Environment: Check only Production ✅
- Name:
- Click Save
3. Optional: Preview Deployments
For branch previews, repeat the above with a Preview Deploy Key:
- Use "Generate Preview Deploy Key" from Convex Dashboard
- Set same
CONVEX_DEPLOY_KEYin Vercel but check only Preview ✅
🎯 Result: Full Automation
After setup, every git push will:
- ✅ Auto-deploy Convex functions to production
- ✅ Auto-build and deploy frontend
- ✅ No more manual deployment steps
- ✅ No more production errors from missing Convex functions
🔧 Manual Deployment (Backup)
If you need to deploy manually:
# Deploy Convex functions only
cd apps/homepage-web && npx convex deploy
# Deploy both Convex + Frontend
cd apps/homepage-web && npx convex deploy --cmd 'cd ../.. && pnpm turbo build --filter=homepage-web'📋 Verification
After setting up the environment variable:
- Make any small change and push to main branch
- Check Vercel deployment logs - should show Convex deployment step
- Production site should work without manual Convex deployment
Note: The CONVEX_DEPLOY_KEY environment variable is the only manual step required. Everything else is now automated! 🎉