Support Forums

Automatic deploy only from specific repo folder

Hello everyone!

Question about automatic deploy from GitHub: is it possible to trigger the deploy only when the git push changes something inside a specific folder?

I have a GitHub repository with multiple sites:

±- site-01
±- site-02
±- site-03

Is it possible to limit automatic deploys only if something new is pushed to site-01?

I’d like to avoid automatic deploy if I push a change to README.md, for example.

A push to site-01 should only trigger automatic deploy to itself and not all the other sites. Is this possible?

Thanks a lot!

Hi @ramigs,

Currently that’s not possible, though it might be with github actions, it’s not something that we natively support. One option that you have is to filter your webhooks using a lambda function. Have github send the webhook to the function, then in the function you can parse the payload and then decide whether or not to trigger the build from there.

Thanks @futuregerald!

I’m working on the suggested solution. When I finish I’ll share it here, in case someone else needs something similar.

1 Like

thanks for doing that @ramigs!

@ramigs were you able to get this working, if so can you share the solution?

@ramkumar yes, I did.

You can find the code here.
I’ve added the instructions in the README.

Notice that you’ll also need to contact Netlify’s support and request the disabling of automatic deploys for all your sites in the mono-repository, while still maintaining the repo linked to Netlify, as mentioned here.

1 Like