Use cases for Github Actions
These days many systems are built with Unix Philosophy in mind, but the applications are in the form of containers. How many malicious containers images would be out there? :)
Here are a couple of examples where I leveraged Github Actions to glue such applications:
Publishing this blog with HUGO
Frustrated with jekyll ndependency hell I decided to swith to HUGO. It’s fast, really fast. And does whatever I need it to do.
Each time I push commits to this repository, this repository is checked out, hugo generates the static website and that website is push to gh-pages for delivery.
https://github.com/timvw/timvw.github.io/blob/master/.github/workflows/publish.yml
PS: Whenever azure blob-storage (or static websites) gets proper support (no DNS flattening hacks) for hosting websites from a storage account I might consider moving the hosting over there…
Releasing on central
With the shutdown of travis-ci.org in sight it was time to migrate to an alternative system to release artifacts on central.
Each time a commit is pushed to this repository, a build (and test) is triggered. Whenever a tag is pushed, that tag is released.
https://github.com/timvw/frameless-ext/blob/master/.github/workflows/ci.yml
Managing cloud infrastructure
When you have automated the provisioning of your cloud infrastructure with a tool such as Terraform you may want to automate the roll-out as well. Careful, as this currently requires some annoying “in between” steps to avoid big bang deployments. You probably do not want to replace an entire pool of nodes by simply wiping it and putting another pool in place (but do it in a phased approach.
So, each time a PR is created (or updated) we run terraform plan to validate the output and add a comment to the PR displaying the output. When the PR is merged into master you we run terraform apply (and add a comment to the commit with the output).
https://gist.github.com/timvw/7a245947a9b3b027d5a0fcd5ad3d9977
PS: In this example we have multiple terraform modules, which are all planned/applied via a matrix and terraform’s -chdir parameter.