Hacker News new | ask | show | jobs
by cmcconomy 1363 days ago
I now use a Makefile and put as much logic as I can in `make cicd` so I can call it in a single line, keeping the GitHub action as simple as possible.
4 comments

Absolutely. The problem is when you have a lot of time-consuming steps and you only want to re-run the failed one with a slight change and then continue where it left off. Make can do that of course, but you need to make Make do it, and save/restore a workspace/artifacts. I haven't done that in GHA and GHA has lacked a lot of core ci/cd functionality for a long time, so I don't know if it's possible in GHA.
Steps that only cache their final artifact on success, and an if condition on the skippable steps that only runs if the artifact doesn't exist. I'm using this to prevent re-running builds when a successful build for the same SHA already exists, for instance.
+1 for Justfiles[1]! They're a much saner alternative to makefiles with great shell support

[1] https://github.com/casey/just

containers are where you want to be, if you can do it.

BYO environment.

Makefile or Ansible playlist, depending on what you're doing? Use Github Actions to prep the environment to run make or Ansible?