Publish only on GitHub tag/release

To unify the deploy process across my organization’s branching structure, I would like a Netlify site to only have the changes published with a new GitHub release. I thought about doing this with the Netlify CLI using GitHub Actions to trigger a deploy on release – however, there is currently no way to only publish sites with a GitHub release, as leaving autopublish on would publish all commits to master, and there does not seem to be any way in the UI to disable automatic builds from master.

Two things would help with this:

  1. The ability to turn off automatic builds for the production branch, while still leaving autopublishing on
  2. A way to mark a certain commit/git tag as publishable with the Netlify CLI, so it would automatically publish that revision once the build finishes (or if it has already finished)

You can accomplish #1 already, @yunyu - we can make sure that your code triggers no automatic builds, but is still connected to git. Then you could make some extra effort to trigger a build - e.g. via a special webhook that you hit only when there is a release - and then you can either let those builds be autopublished, or use the API to publish a new one.

Let me know if you’d like your site or sites converted to that behavior; it’s a 0-downtime database setting that I can put in place for you.

#2 I’ve added you to the open feature request we have, which says something like “make releases a selectable ‘event’ for Netlify builds - and thus, deploys”. We’ll follow up in this thread if we implement that.

We are also pretty close to releasing a new beta feature called build plugins that you can read about here, that gives you more control over how we build/deploy:

…which might be a more direct path to the result you request, since I don’t think we’ll implement that feature request very soon.