Reputation: 139
For those that are familiar with Github Actions...
At present, when a job runs, it picks the most suitable runner for the job based on labels and repository (Using self-hosted runners in a workflow - GitHub Docs). My question is whether it is possible to run a single job on every runner that’s meets the requirements of a job.
For example, I have multiple runners, both self-hosted and hosted by Github; I have a job that contains a script that does the following when code is pushed to the repo:
This “action” needs to take place on every runner that the action has access to.
I hope this makes sense!
Upvotes: 14
Views: 5007
Reputation: 264
According to official documentation you should use strategy
option in your job, where you can define on which machine you want your job to run.
Although I didn't find specific use-case for combining github and self-hosted runners, I'd try something like this:
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, self-hosted]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Upvotes: 9