A continuous-deployment workflow lets every push and pull request build and deploy to Vercel automatically, with tests as a gate. This generator produces a ready-to-commit GitHub Actions YAML file that uses the official Vercel CLI to create preview deployments on pull requests and production deployments when you merge to your release branch.
How it works
The workflow uses three repository secrets — VERCEL_TOKEN, VERCEL_ORG_ID, and VERCEL_PROJECT_ID — and follows Vercel’s recommended three-step CLI flow:
vercel pulldownloads the environment configuration for the target environment (preview or production).vercel buildcompiles the project locally into the.vercel/outputdirectory.vercel deploy --prebuiltuploads that pre-built output, skipping a redundant remote build.
The job is conditioned on the event: pull requests run the preview path, and pushes to your chosen branch add the --prod flag so the deploy is promoted to your production domains.
Tips and notes
- Run
vercel linkonce locally to generate.vercel/project.json; itsorgIdandprojectIdare the values you store as secrets. - Add a separate
testjob that the deploy jobneeds:so a failing test blocks the deploy. - Use
concurrencyto cancel superseded preview deploys on the same branch and save build minutes. - The
VERCEL_TOKENshould be a scoped token created under your Vercel account settings, not a personal access token with broad rights.