Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Continuous Deployment on netlify

I have a project where I use Travis CI for CI. I also have a website setup at netlify to deploy said project to. The steps involved in my Travis CI are basically to run tests and then call a netlify build hook to trigger a build and deploy on netlify.

However, the problem I'm running into is that netlify does a build and deploy every time the master branch is updated. So, what I'm trying to achieve is this

  • master branch updated
  • travis build triggered
  • after travis finishes it calls netlify build hook which start netlify deploy

There seems to be an option with netlify to add a skip-ci commit message but I'm hoping for a better and automated solution.

like image 858
reggaemahn Avatar asked Sep 30 '19 04:09

reggaemahn


People also ask

What is continuous deployment in Netlify?

What is it? Basically it means that we build, configure and deploy your site every time you push to Git (be it a self-hosted repo, GitLabs, Bitbucket or of course GitHub). So you don't have to do anything manually.

Does Netlify auto deploy?

As you push changes to Git, Netlify will automatically build and deploy from your main branch.

Is Netlify continuous integration?

Continuous integration has never been simpler. Netlify can connect to any Git repository hosted at GitHub, GitLab, or Bitbucket and auto publish every time you push a commit.


Video Answer


1 Answers

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"

enter image description here

"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.

enter image description here

like image 102
talves Avatar answered Sep 23 '22 17:09

talves