How to stop Netlify from building and publishing whenever I push new changes to master branch

If you add [skip ci] or [skip netlify] in a commit message Netlify will skip the build (even when builds are active.) This could allow you to trigger a build via the API. Alternatively you can use Netlify CLI.

This post might interest you too