Skip to content

thenickygee/vercel-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Vercel Deploy GitHub Action

A custom GitHub Action workflow to deploy your project to Vercel automatically when pushing to main.

Problem Solved

Have you ever encountered this error?

- Error: Git author [userEmail] must have access to the team [teamName] on Vercel to create deployments.

This workflow solves that issue by properly configuring automated Vercel deployments through GitHub Actions.


Setup Guide

1. Directory Structure

Create the following structure in your repository:

.github/
└── workflows/
    └── vercel-deploy.yml

2. GitHub Actions Configuration

  1. Navigate to the Actions tab from your main repository page
  2. Click "Skip this and set up a workflow yourself"
  3. Paste the YML file contents from this repo (or add the file locally and commit to skip this step)
  4. Commit the changes
  5. Pull the changes to get the file locally

3. Environment Variables Setup

Add Repository Secrets

  1. Navigate to the Settings tab from your main repository page

    Settings

  2. Click on "Secrets and variables" from the sidebar

    Secrets and Variables

  3. Click on "Actions" from the subnav

    Actions Subnav

  4. Click "New repository secret"

    New Repository Secret

  5. Add the following three secrets:

    • VERCEL_TOKEN
    • VERCEL_ORG_ID
    • VERCEL_PROJECT_ID

    Repository Secrets


Getting Your Vercel Credentials

VERCEL_TOKEN

  1. Click your user profile in the top right corner

  2. Click "Account Settings"

  3. Navigate to "Tokens" from the left sidebar

    Vercel Navigation

    Tokens Menu

    Tokens Page

  4. Click "Create" to generate your token

    Create Token

  5. Copy and save the token - you won't be able to access it again after closing the modal

VERCEL_ORG_ID

  1. Navigate to vercel.com/account

    Account Page

  2. Scroll down to find "Team" and copy the Team ID

    Team ID

VERCEL_PROJECT_ID

  1. Navigate to your Vercel dashboard

  2. Click the ellipses button (...) on your desired project

  3. Click "Settings"

    Project Settings

  4. Copy the Project ID

    Project ID

Verification

Your repository secrets should now look like this:

All Secrets Configured


Deploy

Commit and push to main! You should see:

  1. The GitHub Action trigger and pass

    Action Success

  2. Your project deploy to Vercel

    Vercel Deployment


🫡 You're all set!

Your Vercel deployments will now trigger automatically on every push to main.

About

This is a yml file for a custom github action to help you deploy to vercel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published