matcheek
matcheek

Reputation: 5147

Trigger a Vercel deployment only for changes in a particular git branch

I have two Vercel projects using the same github Nextjs repo but using different branches. I have different names setup for "production" branches for both project. One is "master" the other one is "UAT".

The current behaviour is that any change on master triggers both deployments which is redundant. Is there any way to limit these deployments so that a project only gets deployed when the source branch changes. And not just any branch.

enter image description here

Upvotes: 2

Views: 4482

Answers (2)

Josh
Josh

Reputation: 11

You can also use Vercel -> Project Settings -> Git -> Ignored Build Step

Ignored Build Step Config

This will stop builds unless there are changes in the folder specified. So you can just set each project only build on changes in their respective folders.

Upvotes: 0

MohamedZh
MohamedZh

Reputation: 466

You could change the production branch to one of your branches, and for the other branch use a Deploy hook and make a github workflow to call the hook whenever you push to that specific branch. You can use this tool for making a workflow with http requests: HTTP request action

Upvotes: 2

Related Questions