Skip to content

Instantly share code, notes, and snippets.

@ADTC
Last active July 8, 2026 13:16
Show Gist options
  • Select an option

  • Save ADTC/63ce24ca5a6c306f05d75ad2d6975e93 to your computer and use it in GitHub Desktop.

Select an option

Save ADTC/63ce24ca5a6c306f05d75ad2d6975e93 to your computer and use it in GitHub Desktop.
Example GitHub Actions workflow for deploying to Vercel without connecting GitHub account
name: Deploy to Vercel
on:
push:
branches:
- main
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel project settings
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to production
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

Secrets

In GitHub → Settings → Secrets and variables → Actions, create these 3 secrets (not variables):

VERCEL_TOKEN

Create at vercel.com/account/tokens on the Vercel account that owns the project.

VERCEL_ORG_ID and VERCEL_PROJECT_ID

Run vercel link in the project, then check the .vercel/project.json file.

Alternative: Open the project in Vercel, and go to Settings → General. You'll find the ID's there.

Other notes

Ensure that GitHub Actions is enabled for your GitHub project.

In this gist, the file .github__workflows__deploy.yml needs to be created as .github/workflows/deploy.yml (with the folders).

Important: If you previously linked a GitHub project in the Vercel project, you need to disconnect that. This will prevent commit pushes from creating "Blocked" deployments in Vercel before the GitHub Actions workflow runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment