Hi, @root and welcome to the Netlify community site.
The answer that @devotox gave is correct (and thank you for answering, @devotox). Go to Site Name > Settings > Build & deploy > Build settings and then click the “Edit settings” button to link a new repo to the site.
@Ygilany, the repo has been unlinked from that site.
Sure, @root. Both @devotox and I did answer this question. I’ll be happy to go into more detail though.
We are unlinking sites here so that people can still use manual deploys but stop deploys from occurring when a git push to the upstream repo happens.
So, if you want start deploying again for the git push events, just re-link the repo again (or a different repo if that is want you want to do). That is done at Site Name > Settings > Build & deploy > Build settings, then click “Link site to Git”.
I said the button was labeled “Edit settings” earlier but I was wrong. When no repo is linked it is labeled “Link site to Git”. Here is a screenshot to clarify:
Thanks for the clarification! I think I should have clarified myself, though - our site is already linked and has been linked, and so when I click into Build settings, I do see “Edit settings” and then details about the link that already exists. However, it appears that git push events to the specified branch do not actually trigger a rebuild since I had written in to have automatic deploys disabled for our site. How would I go about re-enabling automatic deploys after having written in to have them disabled? (Also worth nothing that auto-publishing is already enabled on our site, so that isn’t the issue.)
Does the unlinking + manual deploys method still allow Build Hooks to work? I want to only publish after a certain step of my CI (deploying new serverless functions) passes. I really wish there was an easier solution, but it seems that stopping auto publishing also disables Build Hooks, and then the build won’t automatically run
Currently I’m considering:
stopping auto-publishing, but continuing auto builds
From my CI environment, use env variables to parse what github commit hash is building
If the branch is master, use the netlify CLI / API to contact the netlify GET /api/v1/sites/:site_id/deploys API to find the commit_ref that matches
Use POST /api/v1/sites/:site_id/deploys/:deploy_id/restore to effective ‘restore’ aka publish that desired commit
Will this work? Does anyone know a better way?
I wish there was an analogous feature to Build Hooks that was essentially a Publish Hook (make a POST request to a URL to publish a build, while specifying parameters to specify which build)
Hi, @brianjychan, if you are doing a build in some CI system you can skip building at Netlify and directly deploy the locally built site to Netlify from the CI system itself.
This is done using manual deploys and the Netlify CLI tool:
To summarize, you can install Netlify CLI as a build dependency in the CI system and when the checks pass you can the CI script/system then executes netlify deploy --prod for the the “publish directory” (as we call it at Netlify). If this is done you will know the version deployed exactly matches you CI build because it is the version from the CI build.