CI/CD for Vercel
Build, test, and deploy a Next.js application to a Vercel production environment.
Use template →1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
steps: - label: ":vercel: Build" key: "build" command: - npx vercel pull --yes --environment=production --token="$VERCEL_TOKEN" - npx vercel build --prod --token="$VERCEL_TOKEN" plugins: - docker#v5.9.0: image: "node:20.11" - artifacts#v1.9.2: upload: ".vercel/output" compressed: .vercel/output.tgz - label: ":jest: Test" key: "test" commands: - npm install - npm test plugins: - docker#v5.9.0: image: "node:20.11" - label: ":vercel: Deploy" depends_on: ["build", "test"] if: build.branch == "main" command: npx vercel deploy --prebuilt --prod --token="$VERCEL_TOKEN" plugins: - docker#v5.9.0: image: "node:20.11" - artifacts#v1.9.2: download: ".vercel/output" compressed: .vercel/output.tgz
- Languages
- JavaScript
- Use cases
- Continuous deployment, Web application
- Platforms
- Vercel
- Tools
- Next.js
CI/CD for Vercel
Build, test, and deploy a Next.js application to a Vercel production environment.
Use template →CI/CD for Vercel
This templates gives you a continuous deployment (CD) pipeline that builds, tests, and deploys a Next.js application to Vercel.
At a glance:
- For Vercel web applications
- Uses npm
- Requires Docker
- Uses Vercel CLI
- Runs Jest unit tests
How it works
This template:
- Installs the Vercel CLI using npm.
- Pulls production Vercel environment information.
- Builds an application for production, outputting a
.vercel/output
folder, which is available as an artifact. - Runs Jest unit tests.
- Deploys the prebuilt application to Vercel production environment.
Next steps
After you select Use template, you’ll:
- Connect the Git repository with your Vercel application.
- Configure Buildkite with the following secrets:
VERCEL_TOKEN
,VERCEL_ORG_ID
,VERCEL_PROJECT_ID
. - Configure the compute—run locally, on-premises, or in the cloud.
- Run the pipeline.
You can then play around with the pipeline settings. For example, run the pipeline locally while you iterate on the definition or set a schedule to trigger a nightly build.
If you need help, please check our documentation, raise an issue , or reach out to support.