🔥Let’s Do DevOps: GitHub Reuseable Actions — Theory, Matrix, Concurrency, Make it all Dynamic 🚀
This blog series focuses on presenting complex DevOps projects as simple and approachable via plain language and lots of pictures. You can do it!
Hey all!
I’ve been spending my whole work days playing with GitHub Actions to attempt to build templates and permit my developers to scale horizontally out with minimal code changes. There’s so many cool features I’ve been discovering, like reuseable actions and dynamic matrixes.
For this post, I want to talk about a project I completed recently — we have a Terraform Plan & Deploy Action that accepts an input for which environment to target. However, we have ~50 environments that could be targeted. Sometimes we want to call lots of them, or make sure all environments are up to date. That horizontal scaling is an excellent technical challenge.
To build it, I created an Orchestration Action that finds all the potential target environments, uses substring or regex matching input (say you only want to target the dev-
environments), and then concurrently executes Terraform Plan & Apply against all the environments you selected. It works incredibly well, and runs like ✨butter✨.