🚀 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:

  1. 🔄 Deploy Convex functions first
  2. 🏗️ Build the Next.js frontend
  3. 🚀 Deploy both together

🔑 Required: Vercel Dashboard Setup

You need to configure the CONVEX_DEPLOY_KEY in Vercel dashboard:

1. Get Production Deploy Key

  1. Go to Convex Dashboard
  2. Navigate to your project's Settings page
  3. Click "Generate Production Deploy Key"
  4. Copy the generated key

2. Set Environment Variable in Vercel

  1. Go to your Vercel Dashboard
  2. Select your project
  3. Go to SettingsEnvironment Variables
  4. Add new variable:
    • Name: CONVEX_DEPLOY_KEY
    • Value: [paste the key from step 1]
    • Environment: Check only Production
  5. 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_KEY in 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:

  1. Make any small change and push to main branch
  2. Check Vercel deployment logs - should show Convex deployment step
  3. 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! 🎉

On this page