Vercel
Deploys a release artifact to Vercel as a production deployment.
The target extracts a ZIP artifact and deploys it via the Vercel deploy API (using @vercel/client) to promote it to production. It does not use or require the vercel CLI.
Configuration
Section titled “Configuration”| Option | Description |
|---|---|
prebuilt |
Whether the artifact contains a prebuilt .vercel/output (the result of vercel build). When true (default), the artifact’s prebuilt .vercel/output is uploaded and the remote build step is skipped. Set to false to have Vercel build from source. |
workingDir |
Subdirectory within the extracted artifact to deploy from. |
orgId |
Vercel organization/team ID. Use this for a repository-specific team; VERCEL_ORG_ID overrides it when set. |
projectId |
Vercel project ID. Use this for a repository-specific project; VERCEL_PROJECT_ID overrides it when set. |
Environment Variables
Section titled “Environment Variables”| Name | Required | Description |
|---|---|---|
VERCEL_TOKEN |
Yes | Vercel access token. Passed to the deploy API, never on the command line. |
VERCEL_ORG_ID |
No | Vercel organization/team ID. An identifier, not a secret. Forwarded to the deploy API as the team ID so the deployment links non-interactively. |
VERCEL_PROJECT_ID |
No | Vercel project ID. An identifier, not a secret. Forwarded to the deploy API as the project identifier so the deployment links to the intended project non-interactively. |
Default Behavior
Section titled “Default Behavior”By default, this target:
- Looks for a single artifact matching
vercel.zip(or*-vercel.zip). Override withincludeNames. - Extracts its contents (preserving the archive layout, e.g. a top-level
.vercel/output). - Deploys to production via the Vercel deploy API.
The version being released is attached to the deployment as metadata (release=<version>) for traceability.
Example
Section titled “Example”targets: - name: vercel orgId: team_example projectId: prj_example # prebuilt defaults to true: the docs site is built in CI and this # target only promotes the prebuilt output to production.Deploying from a subdirectory of the artifact:
targets: - name: vercel workingDir: docsWorkflow
Section titled “Workflow”- Build the site in CI (e.g.
vercel build) and create avercel.zipartifact containing the prebuilt.vercel/output(or the source whenprebuilt: false). - Configure the target in
.craft.yml. - Set
VERCEL_TOKENin your environment. SetorgIdandprojectIdin.craft.yml, or setVERCEL_ORG_IDandVERCEL_PROJECT_IDwhen the shared publish environment must override the repository config.