TLDR
-
.github/workflows/reusable.yml
-
.github/workflows/ci.yml
Some Context
Lately, I had an honor to take on a project that will serve many people in need. Of which, the CI/CD pipelines need a job to build artifacts as PR's preview build after CI, or in CD to generate production builds.
Requirements for the build job in CI or CD are almost identical, thus the idea of extracting the build job as a reusable workflow to be used in pipelines.
Gotchas - Unrecognized named-value: 'secrets'
In job's with
section, GitHub Actions does NOT recognize secrets, i.g., attributes keyed by secrets
. We will need to turn to secrets
section to pass the secrets over from one workflow to another.
Pour Closure
Seems that GitHub Actions iterates pretty quickly that many StackOverflow answers are already render stale. For workflow syntax, ChatGPT can only help to a certain extent. I still had to go back to docs to make sure that things work as I intended them to.