Member-only story
Trigger a GitHub Actions workflow when a folder changes
Recently I’ve been working with GitHub and creating a lot of workflows. I have a couple of GitHub repositories that store both software code and infrastructure as code.
Every time I made a change to the software code it would trigger the infrastructure part as well, and I didn’t like that fact that my infrastructure was re-deploying every time I made a change to the software.
I found a solution to my problem — GitHub Actions triggers!
What is a GitHub Actions workflow?
Within GitHub a GitHub Actions workflow is an automated process that can be set up within your repositories. A GitHub Actions workflow can automate tasks and jobs for you. It can help you build your Continuous Integration/Continuous Delivery (CI/CD) pipelines.
GitHub Actions triggers
When you create a GitHub Action you can specify when it runs, this is called a trigger. You can specify triggers such as when new code is pushed to the repository, or when a pull request is actioned the workflow will spin into action.
Usually these triggers are set so they kick off when a change happens to a specific branch. But you can take that down another level. You can specific if a change happens to a specific…