We use for us and shared the IaC (Infrastructure as Code) repository for provisioning them.
- "Hey devs, here you go. Now you can install and run whatever you need in your pipelines"
Since then, I’ve been trying to improve our workflows (pipelines).
Here’s the thing: the YAML file is code. And like any other piece of code, it can benefit from clean code principles.
I don’t consider myself a clean code advocate anymore. I mean, I used to be that nick-piti kind of guy, but now I think I’ve grown... wiser🧙♂️?
Some code duplication? yep, fine. Some abstractions? over-engineering.
simpler >> canonically cleaner.
Anyway, reducing code duplication is generally speaking a good thing.
And reducing code duplication in your Github Actions workflows is a good thing 👍
What we have
Two workflows: release.yaml & deploy.yaml.
First, let’s clarify terms—because no, they’re not interchangeable. this question:
- "What does a release mean?"
...It depends. 🤷♂️
In the context of this post -> a web front-end application; I like to picture the output of each workflow:
Release
Build the Docker image and publish it to our image registry (with the appropriate tag).
Input: deployment YAML file.
Output: the server is running the new version.
Alright, this is getting long! I’ll stop here for now. In the next post, I’ll dig into actual GitHub Actions changes I made to reduce code duplication in those workflows. Stay tuned! 🚀
--
thanks for reading.
SOCIAL SHARE CARD GENERATOR