Skip to Content
Setting Deployment PipelineVercel Deploy Hooks

Vercel Deploy Hooks — Quick Setup

Where: Project Settings → Git → Deploy Hooks

Create a hook:

  1. Name it (e.g., main-deploy, staging-deploy)
  2. Select the branch (main or staging)
  3. Hit Create → Copy the URL

You’ll get a unique URL like:

https://api.vercel.com/v1/integrations/deploy/prj_xxxx/yyyy

Trigger a deploy:

curl -X POST https://api.vercel.com/v1/integrations/deploy/prj_xxxx/yyyy

Create Staging Environment on Vercel

Where: Project Settings → Environments

1. Create the staging environment:

  • Click “Create Environment”
  • Name it staging (or Staging)
  • Set Branch Tracking → staging - you will have to create staging branch on GitHub first
  • Optionally attach domain
  • Import Variables from production environment

2. Disable Deployment Protection:

Navigate to project settings -> Deployment Protection:

  • Deployment Protection → Vercel Authentication → OFF

Now anyone with the URL can view staging without logging in.

3. Add a custom domain (optional):

Project Settings → Domains → Add staging.yourdomain.com

Edit → assign it to the staging environment/branch.


GitHub Actions Setup

1. Store the hook URL as a secret:

Repo → Settings → Secrets and variables → Actions → New repository secret

  • Name: VERCEL_DEPLOY_HOOK_MAIN (and/or VERCEL_DEPLOY_HOOK_STAGING)
  • Value: your deploy hook URL

2. Create workflow file .github/workflows/deploy.yml:

name: Trigger Vercel Deploy on: push: branches: [main, staging] # or trigger manually: workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy Main if: github.ref == 'refs/heads/main' run: curl -X POST ${{ secrets.VERCEL_DEPLOY_HOOK_MAIN }} - name: Deploy Staging if: github.ref == 'refs/heads/staging' run: curl -X POST ${{ secrets.VERCEL_DEPLOY_HOOK_STAGING }}
Last updated on