Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

vercel-action

> 开发工具
Open source

This action make a deployment with github actions instead of Vercel builder.

761 stars0 likes1 views
WebsiteGitHub

About

This action make a deployment with github actions instead of Vercel builder.

Vercel Action

This action was formerly Zeit Now Deployment. Migration Guide

Introduction to Vercel

Vercel is a cloud platform for static sites and Serverless Functions that fits perfectly with your workflow. It enables developers to host Jamstack websites and web services that deploy instantly, scale automatically, and requires no supervision, all with no configuration.

This action make a Vercel deployment with github actions.

  • Deploy to Vercel.
  • Comment on pull request.
  • Comment on commit.
  • Password Protect ( Basic Auth )
  • Alias domain to deployment.
  • Create Deployment on GitHub.

Result

pull request example

commit

Inputs

Name Required Default Description
vercel-token
  • [x]

| | Vercel token. see https://vercel.com/account/tokens | | github-comment |

  • [ ]

| true | Its type can be either string or boolean. When string, it leaves PR a comment with the string. When boolean, it leaves PR a default comment(true) or does not leave a comment at all(false). | | github-token |

  • [ ]

| | if you want to comment on pull request or commit. ${{ secrets.GITHUB_TOKEN }} (GitHub token docs) | | github-deployment |

  • [ ]

| false | if you want to create a GitHub Deployment, set true. | | github-deployment-environment |

  • [ ]

| | The environment for the GitHub deployment (e.g., production, staging, preview). If not specified, auto-detects: production when vercel-args contains --prod, otherwise preview. | | vercel-project-id |

  • [x]

| | ❗Vercel CLI 17+,The name property in vercel.json is deprecated (https://zeit.ink/5F) | | vercel-org-id |

  • [x]

| | Vercel team ID (also used as teamId for API deployments). See How can I use GitHub Actions with Vercel | | vercel-args |

  • [ ]

| | Ad-hoc CLI flags forwarded to the Vercel CLI (e.g. --prod --force). Mutually exclusive with experimental-api. | | working-directory |

  • [ ]

| | the working directory | | scope |

  • [ ]

| | Team slug for the Vercel CLI --scope flag. Prefer vercel-org-id, which works in both CLI and experimental API modes. | | experimental-api |

  • [ ]

| false | ⚠️ Experimental. Opt in to API-based deployment via @vercel/client. The CLI is the default and recommended path. The API client relies on an internal Vercel package without semver guarantees and may break across updates. Mutually exclusive with vercel-args. | | alias-domains |

  • [ ]

| | You can assign a domain to this deployment. Please note that this domain must have been configured in the project. You can use pull request number via {{PR_NUMBER}} and branch via {{BRANCH}}. | vercel-project-name |

  • [ ]

| | The name of the project; if absent we'll use the vercel inspect command to determine. #27 & #28 | vercel-version |

  • [x]

| | vercel-cli package version if absent we will use one declared in package.json

Experimental API Deployment Inputs

These typed inputs map onto @vercel/client's DeploymentOptions and VercelClientOptions. They only take effect when experimental API mode is enabled with experimental-api: true (see Deployment Mode below). They are ignored in the default CLI mode.

Note: When experimental API mode is enabled, the API path honors your project's vercel.json — including buildCommand, installCommand, outputDirectory, and framework — along with engines.node from package.json. Projects with custom build scripts (e.g. "buildCommand": "./build.sh") work without a --prod workaround. Fixes #336.

Name Required Default Description
target No preview Deployment target: production or preview
prebuilt No false Deploy prebuilt output (requires a prior vercel build step). Mutually exclusive with vercel-build.
vercel-build No false Run vercel pull + vercel build inside the action before deploying, then upload .vercel/output via the prebuilt path. Mutually exclusive with prebuilt. See "Build inside the action" below.
vercel-output-dir No Custom path to prebuilt output. Defaults to {working-directory}/.vercel/output
force No false Force new deployment, bypassing dedupe and build cache
env No Environment variables (KEY=VALUE per line)
build-env No Build-time environment variables (KEY=VALUE per line)
regions No Deployment regions, comma-separated (e.g. iad1,sfo1)
archive No Upload format: tgz for compressed archive
root-directory No Root directory of the project relative to the repository root
auto-assign-custom-domains No true Automatically assign custom domains to this deployment
custom-environment No Custom environment slug or ID
public No false Make deployment source publicly accessible
with-cache No false Retain build cache from previous deployments

Outputs

preview-url

The url of deployment preview.

preview-name

The name of deployment name.

deployment-id

The GitHub Deployment ID. Only set when github-deployment is true. Can be used by downstream steps to reference the deployment.

Claude Code Skill

This repository ships a Claude Code agent skill so AI assistants can wire amondnet/vercel-action into a workflow correctly — covering required tokens and IDs, CLI vs experimental API mode, prebuilt flows, alias domains, GitHub Deployments, and the action's outputs.

Install

bash
npx skills add amondnet/vercel-action

Once installed, prompts like "deploy to Vercel from GitHub Actions", "post a Vercel preview URL on a PR", or "set up prebuilt Vercel deployments" surface the skill automatically.

The skill source lives at skills/use-vercel-action/SKILL.md — every input it documents is cross-checked against action.yml.

How To Use

Disable Vercel for GitHub

The Vercel for GitHub integration automatically deploys your GitHub projects with Vercel, providing Preview Deployment URLs, and automatic Custom Domain updates. See Git Configuration for more details.

We would like to use github actions for build and deploy instead of Vercel.

Disable automatic deployments by setting git.deploymentEnabled: false in your project configuration.

Using vercel.ts (recommended)

Install @vercel/config and create a vercel.ts file:

typescript
import type { VercelConfig } from '@vercel/config/v1';

export const config: VercelConfig = {
  public: false,
  git: {
    deploymentEnabled: false,
  },
};

Using vercel.json

json
{
  "public": false,
  "git": {
    "deploymentEnabled": false
  }
}

Note: The github.enabled property is deprecated. Use git.deploymentEnabled instead. See Turning off all automatic deployments.

Skip vercel's build step

Since we do the build in github actions, we don't need to build in vercel.

Method 1 - Prebuilt deployments (recommended)

You can build your project locally (or in GitHub Actions) using vercel build and upload only the build artifacts to Vercel — without giving Vercel access to the source code. This uses the Build Output API specification.

…

See Vercel's official GitHub Actions example for more details.

Method 2 - Build inside the action (vercel-build)

If you want the same prebuilt-deploy benefits as Method 1 but prefer not to manage vercel pull / vercel build steps yourself, set vercel-build: true. The action will run vercel pull followed by vercel build inside the runner and then upload the resulting .vercel/output via the prebuilt path.

This mirrors the Vercel KB recommended GitHub Actions workflow but consolidates pull + build + deploy into a single step.

yaml
name: deploy website
on: [pull_request]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: amondnet/vercel-action@v42
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }}
          github-token: ${{ secrets.GITHUB_TOKEN }}
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          vercel-build: true

Notes:

  • vercel-build and prebuilt are mutually exclusive. Use prebuilt: true if you've already produced .vercel/output in an earlier step (Method 1); use vercel-build: true to let the action run the build for you.
  • Build-time secrets (build-env) are forwarded to vercel build.
  • The Vercel token is supplied to the CLI via the VERCEL_TOKEN environment variable (the documented non-interactive auth path), never as a --token argument.
  • When target: production is set, the action p

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptgithub-actionsvercelzeit-now

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具