We run a bunch of end-to-end tests using GH Actions against our site, first locally, then build and deploy it (using Netlify CLI) and command
run: npx netlify deploy --dir build --json | tee deploy.json
deploy.json we get
deploy_url and run smoke tests against it. Then, if everything is good, we deploy to production (which is fast, since the site hasn’t changed)
run: npx netlify deploy --prod --dir build --json | tee deploy.json
We want the production site to get this deploy BUT meanwhile, Netlify deploys the site from GitHub repository, and our site overwrites it from GH Action. At best, this is duplicate work, at worst, the auto-deployed site (directly from GitHub) will be broken. On CI the tests would catch this, but … auto-deploy has already happened.
Is there any way we can ONLY deploy using Netlify CLI, skipping auto-publishing from GitHub but without locking the last prod deploy?
I have found a similar issue Files appear in deploy preview but not in production that explains that IF auto-publishing is OFF, then the last prod deploy stays locked.
GH workflow file: https://github.com/350-mass-cambridge-somerville/350-actions-client/blob/master/.github/workflows/netlify-deploy-prod.yml
Typical GH run: https://github.com/350-mass-cambridge-somerville/350-actions-client/runs/502199055