You can use the Vercel CLI to create custom deployment workflows, which is useful for on-premises or self-hosted scenarios where you need more control over your deployment process.
The Vercel CLI allows you to deploy your projects directly from the command line 1. Here's how you can set up a custom workflow:
Install Vercel CLI:
npm install --global vercel
Authenticate with Vercel:
vercel login
Link your local project (for first-time deployments):
vercel
This creates a .vercel
directory at the root of your project with organization and project IDs 1.
For subsequent deployments:
vercel
vercel --prod
1For on-premises or custom CI/CD pipelines, you can:
Retrieve your Vercel credentials:
projectId
and orgId
from the .vercel/project.json
file 2Set up environment variables in your CI/CD system:
VERCEL_TOKEN
VERCEL_ORG_ID
VERCEL_PROJECT_ID
2Build locally and deploy only the artifacts:
vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
vercel build --token=$VERCEL_TOKEN
vercel deploy --prebuilt --token=$VERCEL_TOKEN
This approach gives you full control over your deployment pipeline while still leveraging Vercel's infrastructure 2. The --prebuilt
flag is particularly useful as it allows you to build your application locally or in your own CI environment and only upload the build artifacts to Vercel, without giving Vercel access to your source code.
This workflow is ideal for organizations that:
Would you like more specific information about integrating Vercel CLI with a particular CI/CD system for your on-premises deployment?