This guide covers two approaches:
- A: Deploy via GitHub Actions (recommended for CI/CD)
- B: Deploy directly via Vercel dashboard (simpler, manual)
- A GitHub repository with this project pushed to it
- A Vercel account (sign up at https://vercel.com using GitHub for easiest setup)
- Supabase project set up and running (see
docs/supabase-setup.md)
Install the Vercel CLI and link the project:
npm i -g vercel
vercel login
vercel linkThis creates a .vercel/project.json file containing orgId and projectId.
- Go to https://vercel.com/account/tokens
- Click Create token
- Give it a name (e.g.,
fcf-tracker-github-actions) - Copy the token value immediately — you won't see it again
In your GitHub repo, go to Settings > Secrets and variables > Actions > New repository secret.
Add these secrets:
| Secret | Value | Where to find it |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
https://xxxx.supabase.co |
Supabase Project Settings > API Keys |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY |
sb_publishable_... |
Supabase Project Settings > API Keys (formerly the "anon" key) |
VERCEL_TOKEN |
Token from Step 2 | Vercel Account > Tokens |
VERCEL_ORG_ID |
team_xxxx or user_xxxx |
.vercel/project.json > orgId |
VERCEL_PROJECT_ID |
prj_xxxx |
.vercel/project.json > projectId |
Once secrets are set, push to the main branch:
git push origin mainThe workflow in .github/workflows/deploy.yml will:
- Install dependencies
- Run lint
- Run TypeScript check
- Build the project
- Deploy to Vercel
Check progress in GitHub: Actions tab > Deploy to Vercel workflow.
- Log in to https://vercel.com
- Click Add New > Project
- Connect your GitHub account and select the repository
- Click Import
Under Environment Variables, add:
| Name | Value |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
https://your-project.supabase.co |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY |
sb_publishable_... |
Click Deploy. Vercel will build and deploy automatically.
After the first deploy, Vercel automatically deploys every push to the connected branch (usually main). No GitHub Actions needed.
After deploying, add your Vercel domain to Supabase:
- Go to Supabase > Authentication > Configuration > URL Configuration
- Under Site URL, enter
https://your-app.vercel.app - Under Redirect URLs, add
https://your-app.vercel.app/auth/callback - Click Save changes
All environments (local, preview, production) need these:
NEXT_PUBLIC_SUPABASE_URL=<supabase-project-url>
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=<supabase-publishable-key>
No other secrets or config are needed.
| Problem | Fix |
|---|---|
Build fails with NEXT_PUBLIC_SUPABASE_URL not set |
Add the env vars in Vercel Project Settings > Environment Variables |
Login redirects to localhost after deploy |
Update Supabase Auth settings with your Vercel URL |
| 404 on page refresh | Vercel handles this automatically with Next.js — no vercel.json redirect needed |
@supabase/ssr import errors |
Run npm install locally and commit updated package-lock.json |
- In Vercel dashboard, go to your project > Settings > Domains
- Enter your domain and follow the DNS configuration instructions
- Update Supabase Auth settings with the custom domain URL