Stopping automatic deploy of your site build
There is the ability to stop auto-publishing per site on Netlify. In the Netlify admin console, login and choose the site > Deploys
then "Stop auto publishing"
"Stop auto publishing" does not turn off builds or previews in Netlify CI for your site. It only stops the atomic deploy of changed site files! To deploy a build, you would have to deploy manually.
Turning off builds for a branch
This will depend on what you are trying to do, but we will walk through a couple cases.
Build case #1 (no build needed)
You might have a site that is being pre-built on a 3rd party CI system, like GitHub Actions as an example, and your workflow is to push your static site changes back to the repository. In this case you are not turning off the build step, but want it to publish when there are changes.
Solution: Create build command that does nothing. For example, "echo 'There is nothing to build here!'"
Build case #2 (no continuous deployment, manual deploys)
Although this is used for CLI deploys there might be other reasons for you wanting to ignore a branch. You just don't want the site to do anything, because it is being built and deployed via netlify-cli
.
This method uploads files directly from your local project directory to your site on Netlify (Read here).
Solution: change your production branch to a non existing branch name in the admin console for the site (ie. does-not-exist
), then turn off deploy previews and set to only build the production branch which does not exist.