Build & Deploy via webhook only

Hi,

I can’t seem to find an option to only build & deploy via a webhook. Is it possible?
This means that i do not want to build/deploy automatically via a git commit/push.

Or an option to only build via a git commit/push and build/deploy via webhook would also be fine.

Thanks!

Hi @lkniep,

You can change the publish branch in your build and deploy settings to something that you would never use, like “this-will-never-deploy”. Or if you are on gitlab or bitbucket you can remove the build webhooks from the repo.

Hi @futuregerald

That was what i did in the first place. Setting ‘Production branch’ to something which does not exist.
But if a build gets triggered via a webhook(which will trigger a build for master) you can’t see it back in the ‘production deploys’ overview… Because the ‘production deploys’ overview shows an overview about the branch which does not exist…

Yes, that’s a drawback with the workaround. You’ll want to view your deploys directly on the deploy page, instead.

This means i can’t use badges for build status right?

Is the option to disable auto build/deploy on commit something that will come in the near future?

there is already a feature to do that - if you include [skip ci] in your commit message, we won’t build. I understand that you probably don’t want to prefix all your commit messages with that, but it is possible.

I don’t think we have plans to change the “how you specify what we build” setup in other ways anytime soon, but we do have an open feature request to allow badges for other branches to which I’ve added this thread for followup in case we ship it.

In the meantime there are some other potential workarounds for you:

  1. locked deploys - we still build everything, but never autopublish it: https://www.netlify.com/docs/locked-deploys/ . This is what we use to disable autopublishing e.g. before a major release. You can publish an existing deploy via our API
  2. give your build script some other smart logic to check if this one is an intended build and build it only in case it matches some pattern (e.g. only build merge requests)
  3. try filtering the webhooks sent to netlify using a service like zapier (“oh, that’s a PR that says WIP in its commit message; don’t forward this one to Netlify!”)