Back to Articles list
Website Devโ€ขPublished Aug 12, 2026โ€ข
SHARE

Deploy One GitHub Repo to 2 Vercel Accounts Automatically

Learn how to deploy one private GitHub repository to two separate Vercel accounts automatically using Vercel Tokens and GitHub Actions.
Deploy One GitHub Repo to 2 Vercel Accounts Automatically

๐Ÿš€ How to Deploy One GitHub Repository to Two Vercel Accounts Automatically

Imagine that you have one private GitHub repository, but you need the same application deployed to two completely separate Vercel Accounts.

Perhaps one belongs to you and another belongs to a client. Or maybe you want the same codebase available in two independent environments.

Doing this manually every time you make a change quickly becomes repetitive.

A better approach is to let GitHub Actions handle the deployment automatically using separate Vercel Tokens.

The workflow then becomes:

Code Change โ†“ git push โ†“ GitHub Actions โ†“ Vercel Account A โ†“ Vercel Account B

Once configured correctly, a normal Git push can trigger both deployments automatically.

๐Ÿ”‘ What Is a Vercel Token?

Vercel Token is an authentication credential that allows tools such as the Vercel CLI to access Vercel on your behalf.

If you have two separate Vercel Accounts, you can create a separate token for each one.

For example:

VERCEL_TOKEN_A VERCEL_TOKEN_B

GitHub Actions can then use these secrets to authenticate each deployment.

โš ๏ธ Important: Never place Vercel Tokens directly inside your source code. Treat them like passwords and store them as GitHub Actions Secrets.

๐Ÿ› ๏ธ Step 1: Create Tokens for Both Vercel Accounts

Log in to Vercel Account A.

Go to:

Account Settings โ†’ Tokens โ†’ Create Token

You can give it a descriptive name such as:

TOKEN_ACCOUNT_A

Generate the token and store it securely.

Then repeat the process with Account B:

TOKEN_ACCOUNT_B

You now have separate credentials for both deployment targets.

๐Ÿ” Step 2: Store Both Tokens in GitHub Secrets

Open your private GitHub repository.

Go to:

Settings โ†’ Secrets and variables โ†’ Actions

Select New repository secret.

Create the first secret:

Name: VERCEL_TOKEN_A Value: Account A token

Then create:

Name: VERCEL_TOKEN_B Value: Account B token

GitHub Actions can now access these credentials without exposing the actual token inside your workflow code.

โš™๏ธ Step 3: Create the GitHub Actions Workflow

Inside your project, create:

.github/workflows/deploy.yml

A basic workflow can look like this:

name: Multi-Vercel Deployment on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Deploy to Vercel Account A run: npx vercel --token=${{ secrets.VERCEL_TOKEN_A }} --prod --yes - name: Deploy to Vercel Account B run: npx vercel --token=${{ secrets.VERCEL_TOKEN_B }} --prod --yes

The first deployment authenticates with Account A's token.

The second uses Account B's token.

๐Ÿš€ Step 4: Push Your Code

Now make a normal Git push:

git add . git commit -m "Update website" git push origin main

The moment GitHub receives the push, the workflow starts automatically.

GitHub Actions runs the deployment steps one after another and sends the application to both Vercel deployment targets.

You no longer need to open both Vercel dashboards and manually trigger deployments.

๐Ÿ“Š The Complete Deployment Architecture

Developer โ”‚ โ”‚ git push โ–ผ GitHub Repository โ”‚ โ–ผ GitHub Actions โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ–ผ โ–ผ Vercel Account A Vercel Account B โ”‚ โ”‚ โ–ผ โ–ผ Website A Website B

This is a simple example of CI/CD automation.

Your Git repository becomes the source of truth, while GitHub Actions handles the deployment workflow.

๐Ÿ’ก One Important Detail: Project Scope Matters

There's an important detail that shouldn't be overlooked.

Using two different Vercel Tokens does not automatically guarantee that every deployment will land in the correct existing Vercel Project.

Vercel also has Project and Team/Account Scope concepts.

If Account A and Account B contain separate Vercel Projects, each deployment needs to be associated with the correct project and scope.

The architecture should therefore look something like:

GitHub Repository โ”‚ โ”œโ”€โ”€โ†’ Vercel Project A โ”‚ โ””โ”€โ”€ Account A โ”‚ โ””โ”€โ”€โ†’ Vercel Project B โ””โ”€โ”€ Account B

This becomes especially important when the two deployments use different domains, environment variables, or production configurations.

๐Ÿ”’ Keep Your Tokens Secure

Vercel Tokens should be treated as sensitive credentials.

Never:

โŒ Hard-code them in source code.

โŒ Commit them to .env files in Git.

โŒ Put them inside README files.

โŒ Share them through screenshots or chat.

Instead:

โœ… Store them in GitHub Secrets.

If a token is accidentally exposed, revoke it immediately and generate a replacement.

๐ŸŽฏ Who Can Benefit From This Setup?

This approach can be useful for:

  • Developers managing multiple Vercel Accounts
  • Agencies working with client projects
  • Teams maintaining independent deployments
  • Developers using one private repository for multiple environments
  • Businesses that need separate production deployments
  • Teams building automated CI/CD pipelines

โšก Quick Summary

RequirementSolution
Private Source CodeGitHub Repository
AutomationGitHub Actions
Vercel AuthenticationVercel Token
Account AVERCEL_TOKEN_A
Account BVERCEL_TOKEN_B
Deployment Triggergit push
HostingVercel

โœ… Final Thoughts

Deploying one GitHub repository to multiple Vercel Accounts doesn't have to mean managing every deployment manually.

With GitHub Actions and separate Vercel Tokens, the process can become part of your normal Git workflow.

The basic architecture is simple:

GitHub โ†’ GitHub Actions โ†’ Vercel Account A + Vercel Account B

The important part is keeping credentials secure and making sure each deployment is correctly associated with its intended Vercel Project and Account scope.

Once everything is configured properly, your workflow becomes much cleaner:

Write code โ†’ commit โ†’ push โ†’ deployments happen automatically.

That's the real advantage of CI/CDโ€”not simply faster deployments, but removing repetitive deployment work from the development process.

---ends here---

Kapesh

Written by Kapesh

Founder & Editor

Kapesh is the founder and technical architect behind One2Tech. He specializes in macOS internals, Apple automation workflows, developer environments setup, and local database design. He writes verified, high-fidelity tutorials to simplify complex computing workflows.

Subscribe to One2Tech Insights

Stay updated with our latest development and tech guides.