We’d love to stop the auto publishing deployment and make the build and publish under manual control.
I know there is a “Trigger deploy” button allowing us to manually trigger the build, as well as the “Publish deploy” button within each build to do the deployment. But we’d like to restrict the access to Netlify UI, hence we think of integrating Netlify CLI with Github Actions.
I thought by using
netlify deploy --prod
would deploy and publish the build into environment anyway, but it was asking to unlock the auto publishing first then do the publish.
◈ Deployments are "locked" for production context of this site
? Would you like to "unlock" deployments for production context to proceed? (y/N)
Are there any ways to publish deploy via Netlify CLI or Netlify APIs without turning on auto publishing?
Hi, @ivanc. You can unlink the repo:
In this workflow, auto-publishing isn’t enabled because a repo must be connected to enable that. Then changes to the repo will never trigger a build at Netlify. However, the manual deploys with the CLI will still work the same way. Unlinking the repo doesn’t affect the manual deploys in any way.
If that doesn’t work, please let us know.
Thanks for your suggestions!
I have figured out a solution for us. I stopped the builds in Netlify and left the auto publishing enabled, which means any merge events from the repo don’t trigger the build in Netlify, we can do the build outside Netlify, then upload the build and publish it onto Netlify via Netlify CLI.
Basically Netlify only plays a CDN host role for us, as we’d like to totally make the build and publish pipeline under our control.
Anyhow, thanks for your response!
Hi, @ivanc. Thanks for sharing your solution. That is another method to achieve the same end result. No build at Netlify but auto-publishing enabled. Either method works.
My suggestion to remove the repo was because it was a single step (easier to explain) and also because, if you are not building at Netlify anymore, there is no reason to leave the repo linked.