Netlify site name: visma-rating.netlify.app
I am running semantic-release in a github action when something is pushed to main. Semantic-release updates the package.json version number and creates a changelog.md, but netlify auto deploys the site before semantic-release is finished updating files. The result is a prod site with a wrong version number.
Is there anything I can do to delay auto-deploy until my script has finished?
Okay, then I tried another solution - “Build settings → Stop builds” and then call netlify-cli after semantic-release in my github action. That did not work either
It didn’t work because instead of deploying it, it write this in the log:
◈ Deployments are "locked" for production context of this site
? Would you like to "unlock" deployments for production context to proceed? (y/N)
Error: Process completed with exit code 130.
It’s kind of difficult to answer when it is part of an automated script
So now I’m stuck, none of my solutions works. What do I do now? Please HELP!
My github action:
name: release
on:
push:
branches:
- main
jobs:
release:
name: Release
...
- name: Deploy Site
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: npm run netlify -- deploy --dir=dist --prod