Current versus Expected Behavior:
I’m trying to achieve the following deployment workflow in Vercel:
- When a PR is raised against the
devbranch, 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!