-
-
Save jonico/a94d03cac7a858e0613926d9f1bc7f2b to your computer and use it in GitHub Desktop.
| name: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| runner: ${{ steps.runner.outputs.runner }} | |
| steps: | |
| - id: runner | |
| run: echo "::set-output name=runner::macos-latest" | |
| test: | |
| needs: [build] | |
| runs-on: ${{ needs.build.outputs.runner }} | |
| steps: | |
| - run: echo I Ran |
@truonghuynguyen: you could experiment with outputs in list format similar to https://github.com/jonico/visualize-actions-matrix-builds-on-k8s/blob/master/.github/workflows/visualize-matrix-build-led.yml#L58
@truonghuynguyen, I have exactly same needs, and it works for me:
runs-on: [ self-hosted, "${{ needs.build.outputs.runner }}" ]
Unfortunately, I couldn't find how to attach several runners dynamically.
I didn't test but, If you have fixed number of runners, than you might try like this:
runs-on: [ self-hosted, "${{ needs.build.outputs.runner1 }}", "${{ needs.build.outputs.runner2 }}" ]
This was super helpful for a project I'm working on, thanks! π
@truonghuynguyen, I have exactly same needs, and it works for me:
runs-on: [ self-hosted, "${{ needs.build.outputs.runner }}" ]Unfortunately, I couldn't find how to attach several runners dynamically. I didn't test but, If you have fixed number of runners, than you might try like this:
runs-on: [ self-hosted, "${{ needs.build.outputs.runner1 }}", "${{ needs.build.outputs.runner2 }}" ]
Works fine for me, thanks!! ππ
Hi @jonico, can we do multiple tags? I tried the similar as above, the value of
outouts.runneris[ tag1, tag2 ], but it treatsoutouts.runneras a whole string, instead of an array of tags.