Bit of an odd workflow - do you really want us to build the preview and then rebuild it to publish, without any changes?
I’d suggest that instead of calling the webhook after your CI passes, you instead call an API endpoint to publish the existing deploy. Saves you $$ on build minutes too
I’m having a similar problem. I just need to deploy & publish using a webhook, not on push.
To prevent deploying on push I set the production branch to a non existing branch. The problem is that the webhook doesn’t autopublish unless the branch is the production one.
Would be nice to have a querystring option for the webhook to force publish or a way to stop building on git push.
Yes, this is possible. If you use GitLab or Bitbucket, you can delete the Netlify webhook in the settings for your repo at your git provider. If you are using GitHub, this is a little more involved so let us know and we can help with that.
Hi Laura, I’m having the same issue where I’d like to only deploy and publish after CI passes, and I’m using Github. Is there any way I can disable the automatic deploy on push to master? I don’t see Netlify in my webhooks, since I’m using the Github App.
Since the Github integration uses an app to manage the connections, there won’t be a webhook to remove. There is a setting that can be set on our side but this cannot be managed by you. If you would like me to set it anyways, let me know which site it is.
Hello!
I am not sure if this the right place to ask, but I would like to deploy only after my CI tests pass, and I could do it using yarn deploy --site #my_site_id --auth #my_token --prod for the production branch.
I can’t find a way to do this for the develop and staging branch though.
Right now all I can find is 2 choices:
1- Set automatic deploys, set branch subdomains and have my code deployed on the correct branch but ignoring my tests
2- Disable automatic deploys and deploy my code to production after my tests pass, but no develop or staging subdomains.
Can you please tell me if there is a way to deploy programmatically to a specified subdomain (branch)?
We are in the same situation on our side. We’d like to only trigger a build and deploy from our master branch once our CI have passed our tests. We are using a build hook to do so, but right now our site builds and deploy twice: once automatically when Netlify detects changes on the master branch, and a second time via our CI build hook once tests have passed.
My netlify username is neoms21 and I’m facing the exact same issue as people here. What I’m assuming that you have to make some setting on your end to stop my sites from auto-publishing on push but from a build hook. I’ve set up one of my repos to be deployed from ‘no_deploy’ and then call the webhook to deploy. It builds fine and deploys the site to master--xxxx.netlify-app.com but doesn’t publish.
Could you please enable that setting for me so that it publishes the site when I call the build-hook on master branch? Could you please do it on both of my sites?
nope! You’ll need to implement that logic in either the ignore script or in your build pipeline. We provide the $WEBHOOK_* environment variables during build:
… and even if you don’t build two different branches (which is the pattern my next link is about), you can use a similar pattern as we describe in this article around doing conditional builds based on that incoming build data, instead of based on the branch or commit type:
Since the Github integration uses an app to manage the connections, there won’t be a webhook to remove. There is a setting that can be set on our side but this cannot be managed by you. If you would like me to set it anyways, let me know which site it is.
Hi team! Can we also get this turned off for our GitHub connection for site: f88acd47-7f30-460f-9d6d-2109f0f523dc We would like to have Netlify build our site but ONLY from a build hook and not on push.
Do let me know if there is a better way to do this these days, but my team and I were a little stumped here! Thank you!