Maciej
Maciej

Reputation: 59

Is it normal for Vercel to initiate a build even if there's a push to the `develop` branch, which is not the production branch?

To reproduce the problem:

  1. I have a project with main, develop, and other task branches.
  2. I deploy the project on Vercel. By default, Vercel looks for the main branch.
  3. When the app was deployed, I temporarily changed the develop branch to serve as the production branch. However, even though I made this change, when a push was made to the remote repository, there was no build on Vercel's side. I tried multiple times, but nothing happened. Only changes made to main triggered a new build.
  4. I spent a couple of hours reading Vercel's documentation and other resources, but I couldn't find anything specific to address my issue.
  5. Eventually, I merged develop into main and adjusted the settings in Vercel, designating back main as the production branch. 6 . A few hours later, any pushes made from develop, as well as from main, triggered a build on Vercel. I became concerned and started to wonder if there might be something wrong with Git under the hood. In fact, I even created a new repository on GitHub, initialized a fresh Next.js project with new Git files, and uploaded it to Vercel, but I encountered the same problem.

Can anyone explain what's happening? Is it normal for Vercel to initiate a build even if there's a push to the develop branch, which is not the production branch?

enter image description here

enter image description here

Upvotes: 0

Views: 686

Answers (1)

Fei
Fei

Reputation: 2006

I think Vercel will trigger a build when it detects an unknown SHA. This won't incur any costs with their current pricing, but if you're concerned, you can configure the "Ignored Build Step" to apply only to production builds.

Ignored Build Step in Vercel

Upvotes: 0

Related Questions