CI/CD for Vercel
Build, test, and deploy a Next.js application to a Vercel production environment.
Use template →1steps:
2 - label: ":vercel: Build"
3 key: "build"
4 command:
5 - npx vercel pull --yes --environment=production --token="$VERCEL_TOKEN"
6 - npx vercel build --prod --token="$VERCEL_TOKEN"
7 plugins:
8 - docker#v5.9.0:
9 image: "node:20.11"
10 - artifacts#v1.9.2:
11 upload: ".vercel/output"
12 compressed: .vercel/output.tgz
13
14 - label: ":jest: Test"
15 key: "test"
16 commands:
17 - npm install
18 - npm test
19 plugins:
20 - docker#v5.9.0:
21 image: "node:20.11"
22
23 - label: ":vercel: Deploy"
24 depends_on: ["build", "test"]
25 if: build.branch == "main"
26 command: npx vercel deploy --prebuilt --prod --token="$VERCEL_TOKEN"
27 plugins:
28 - docker#v5.9.0:
29 image: "node:20.11"
30 - artifacts#v1.9.2:
31 download: ".vercel/output"
32 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.