DEV Community

Discussion on: Tips and Tricks for GitHub Actions

Collapse
 
michaelcurrin profile image
Michael Currin • Edited

Thanks for sharing.

For deploys, A more common flow than checking a specific commit message is to deploy on a release or tag.

I have a cheatsheet for triggers, to summarize the most useful parts of the events doc.

michaelcurrin.github.io/dev-cheats...

on:
  release:
    types: created
Enter fullscreen mode Exit fullscreen mode

GH docs on release
NPM publish in the GH docs which uses release.

To match your prod and staging flows, you could decide to always deploy staging on a push but only deploy production on a tag.

Collapse
 
msfjarvis profile image
Harsh Shandilya

That's right! I also use this workflow in my other repos. The one I shared in the post was what I use for my website, where tagged releases don't make much sense.