You can use the Vercel CLI with any CI/CD provider such as Azure DevOps to generate Preview Deployments for every
git push and deploy to Production when code is merged into the
This approach is useful for developers who want full control over their CI/CD pipeline as well as those who can’t leverage Vercel’s built-in git integration. Another use for this setup would be a trunk-based development workflow.
Building Your Application
You can build your application locally (or in a pipeline) without giving Vercel access to the source code through
vercel build. Vercel automatically detects your frontend framework and generates a
.vercel/output folder conforming to the Build Output API specification.
vercel build allows you to build your project within your own CI setup and upload only those build artifacts (and not the source code) to Vercel to create a deployment.
Deploying Your Application
There are 3 options for deploying your application:
git push: Uploads all local branch commits to the corresponding remote branch
vercel deploy: Build a project locally or in your own CI environment
vercel deploy --prebuilt: Deploy a build output directly to Vercel, bypassing the Vercel build system
Creating a Custom Workflow
- Retrieve your Vercel Access Token
- Install the Vercel CLI and run
- Inside your folder, run
vercel linkto create a new Vercel project
- Inside the generated
.vercelfolder, save the
VERCEL_PROJECT_IDas environment variables in your CI/CD provider
1npm install --global vercel2vercel pull --yes --environment=preview --token=YOUR_VERCEL_TOKEN3vercel build --token=YOUR_VERCEL_TOKEN4vercel deploy --prebuilt --token=YOUR_VERCEL_TOKEN
Examples of Custom Workflows
The following examples show how to use the Vercel CLI as shown above: