Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Latest commit

 

History

681 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

actions-vercel

CI Release Marketplace License Stars Used by

Deploy Vercel projects from GitHub Actions with control over builds, environments, and integrations.

Overview

nexterias/actions-vercel is a GitHub Action that deploys Vercel projects from GitHub Actions. By building the project on the GitHub Actions runner when necessary and deploying it to Vercel, it can reduce Vercel-side build time to zero.

Features

  • 🚀 Switch between preview and production deployments.
  • 🧹 Remove preview deployments from Vercel when their associated branches are deleted.
  • 🏗️ Deploy the build result from GitHub Actions with prebuilt: true.
  • 🔗 Integrate deployments with pull request comments, commit statuses, and GitHub Deployments.
  • 🧩 Add custom steps such as tests and notifications before or after deployment.

Usage

name: Vercel

concurrency:
  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref || github.ref }}
  cancel-in-progress: true

on:
  push:
  pull_request:
  delete:

jobs:
  deploy:
    if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.event.deleted == false) }}
    name: Deploy
    runs-on: ubuntu-latest
    permissions:
      contents: read # Required to check out the repository.
      deployments: write # (Optional) Create and update GitHub Deployments.
      statuses: write # (Optional) Create and update commit statuses.
      pull-requests: write # (Optional) Post comments on pull requests.

    steps:
      - uses: actions/checkout@v7

      - uses: nexterias/actions-vercel@v2
        with:
          token: ${{ secrets.YOUR_VERCEL_TOKEN }}
          org-id: ${{ secrets.YOUR_VERCEL_ORG_ID }}
          project-id: ${{ secrets.YOUR_VERCEL_PROJECT_ID }}
          production: ${{ github.ref == 'refs/heads/main' }}
          prebuilt: true # If set to true, build will be performed using GitHub Actions.

  # (Optional) When a branch is deleted from the remote repository,
  # this job removes all preview deployments created for that branch from Vercel.
  cleanup:
    if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' }}
    name: Cleanup deployments
    runs-on: ubuntu-latest

    steps:
      - uses: nexterias/actions-vercel@v2
        with:
          token: ${{ secrets.YOUR_VERCEL_TOKEN }}
          org-id: ${{ secrets.YOUR_VERCEL_ORG_ID }}
          project-id: ${{ secrets.YOUR_VERCEL_PROJECT_ID }}
          cleanup-deployment: true

Documentation

See the documentation for detailed setup instructions and reference information.

Examples

Releases

Packages

Used by

Contributors

Languages