Bootstrapping a ci/cd pipeline is fraught with missteps and re-tries. Sitting there waiting for everything to be fetched, built, tested, deployed etc uses up a lot of time and can slow down development. This is what I've cobbled together to speed things up a bit.
This saves a lot of unnecessary CI/CD work, and is done using the paths-ignore
rule. Here's a snippet of one of my workflow files which is only interested in linting, running and testing the nodejs app and doesn't care at all about anything to do with deployment or provisioning, so I path-ignore that stuff.
# ...
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- 'deploy/**'
- '.github/workflows/tf-*.yml'
- README.md
# ... etc ...
Github actions has a feature that will allow you to trigger a workflow whenever you like, using the workflow_dispatch
trigger:
name: Quick Test Workflow
on:
workflow_dispatch
# ... etc ...
Without this initial commit, github will not list the workflow on the 'Actions' tab of your project, and it needs to be listed before you can trigger it. Once it appears under the actions tab, you can bypass having to always commit to the main branch (see step 5)
Now you can begin rapid testing: Make edits, commit locally and push to github. If you've made your workflow triggers sensible, hopefully the push will trigger only one or no workflows at all, saving you time. Now, head over to the actions tab of your repo after you've pushed your branch.
Here's an example of my workflow that I just called 'Tf Sanity checks' that I use in this way.
That's it! Hope this saves someone some time.