Triggering a deployment to netlify from a release branch with github actions on publish of release on github

We are using netlify where any push to a predefined “main” branch triggers deployment, but now we are looking to move to trunk based development. Here we are planning to create a release branch with a release number ex: release-1.0.0 , after we do that when we publish a new release with that name on github releases, the deployment should be triggered to netlify by picking the provided release branch name dynamically.

So far what i have explored:

  • netlify ui does not support it, they only support pre defined branches for continuous deployment.
  • netlify cli does not have any option to dictate the branch name to use to deploy, so i cannot use it with github actions to do so. (* Let me know if i missed it ?)
  • It does not have an action that can do the same deployment process that is uses internally which we can simply call with a different branch name everytime from github actions on deployment event.
  • It does have problem of unable to read the environment variables from netlify if i use github actions with the action like : Netlify Actions · Actions · GitHub Marketplace · GitHub

Looking forward to learn and implement it with your help.

1 Like