How to stop Netlify from building and publishing whenever I push new changes to master branch

I have been looking for the solution for all day long. I want to connect circleci and Netlify. When I push new changes to my master branch on Github, Netlify builds and deploys right away. I don’t want that. I want circleci to pass all the tests and only when all the tests are passed, call the web hook Netlify provides to build and deploy. How do I achieve that? I tried disabling autopublish on Netlify. If I do that, when I call Netlify Api to deploy, it only builds but not deploy. I am stuck. Please help me

Hi @nyinyihmueaung19

Check out the Stop or activate builds documentation

But, how does that help me? In the doc, doesn’t it say if you stop build, Netlify won’t build even if you call the web hook. I want to call the Netlify Api to build and publish after all the tests are passed. Please correct me if I am wrong. I am very new to Netlify

If you add [skip ci] or [skip netlify] in a commit message Netlify will skip the build (even when builds are active.) This could allow you to trigger a build via the API. Alternatively you can use Netlify CLI.

This post might interest you too

After searching about it on the internet, I came across one solution which is to make your production branch to something that doesn’t exist, then it works. I tried it and it didn’t work. Pushing to git still builds but doesn’t publish. Same with calling the API. Does that actually work? Do you happen to know why it’s not working in my case?? Thanks for the help and sorry to bother you

I’m not surprised this did not work.

Calling the API does not work for you? I could not say why an API does not work as I don’t know how you are doing it. What method are you using to call the API to build? Are you calling the createSiteBuild endpoint?

I built a web hook on Netlify UI and it gives me an endpoint. I call that endpoint if alll the tests are passed on circleci. That is how I am doing it. But, it only builds but doesn’t publish

In your original post you said

Did you enable auto publish again?

Yes, I did publish again.

Could you share the site name @nyinyihmueaung19?