Deploy based on GitHub PR label

Netlify site name: prefect-orion.netlify.app

Netlify automated deploys have been a great tool for us, both publishing our site and generating internal previews on PRs.

The problem that I’m seeing is an over-use of build minutes on PR commits related to non-website changes.

Background: we are publishing an OSS Python library, the documentation website is part of the library repo, and building the API documentation requires the core library components. As an OSS product, we want contributors to be able to contribute to both core code and docs. So…

Back to netlify deploys… for a while, we were deploying previews for any PR merge even if not related to site changes. That ate a lot of build minutes. For efficiency, I’d like to be able to toggle preview deploys only for those commits that specifically need them.

I don’t actually see a built-in way to do this right now without having a totally separate docs branch, and that is not really compatible with any core API changes folks want to merge on main. Off the top of my head, keying on a “docs” label on a github PR seems like it would be convenient, but not supported by netlify that I can see.

Is there another way to address this problem – deploy only on some characteristic of the PR other than branch?

Yes, you’re looking for ggnore builds:

1 Like