Vercel deployment

Current versus Expected Behavior:

I’m trying to achieve the following deployment workflow in Vercel:

  • When a PR is raised against the dev branch, it should deploy to a preview domain( DomainA)
  • When the PR is merged into dev, it should deploy to the production domain (DomainB`).

However, Vercel is not allowing me to assign the same branch (dev) to both a preview and production environment for two different domains at the same time. It seems that a single branch cannot be used in both preview and production environments simultaneously.

Code, Configuration, and Steps that Reproduce This Issue:

I have the following domains configured:

Preview Domain: DomainA

Production Domain: DomainB

Both domains are assigned to the dev branch for production in Vercel Dashboard under Settings > Domains.

When a PR is raised on dev, Vercel doesn’t trigger a deployment to the preview domain (DomainA)

unless the PR is merged into dev. This is not the desired behavior because I want to deploy to DomainA as soon as the PR is raised, and then to DomainB once merged.

I would appreciate any guidance or suggestions on how to achieve this deployment flow with Vercel or if there are any limitations or workarounds I should consider. Thank you!

Hi, @muditgarg-renticklec!

I noticed your issue is related to these recent discussions:

All these cases are hitting the same core limitation: Vercel prevents multiple environments from automatically deploying from the same branch. This is designed to prevent deployment conflicts, but it can be challenging when you need different domains/environments (like your DomainA and DomainB) to deploy from the same branch.

I’ve shared similar solutions in the other threads, but here are some potential solutions:

  1. Use separate branches as this gives you the cleanest separation of concerns.

    1. preview branch for DomainA deployments
    2. dev branch for DomainB deployments
  2. Use Vercel’s promotion workflow. This maintains your desired staging → production flow.

    1. Deploy to DomainA first
    2. Use Vercel’s promotion feature to promote to DomainB when ready
  3. Set up a custom CI/CD pipeline:

    1. Keep your current branch structure
    2. Use GitHub Actions to trigger appropriate deploy hooks in sequence
      This gives you the most control over the deployment process.

Let us know how you get on!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.