Setting up a self-hosted runner
So far, we have only used the ubuntu-latest
label for our jobs. This runs the workflows on the latest version of a Ubuntu image hosted by GitHub. But there are also runners on macOS and Windows, with different configurations. You can host your own runners on any platform you like. In this first recipe, we will set up a self-hosted runner in a Linux Docker container. This way, it will be easy to scale it up and clean up the resources after our workflow run.
Getting ready…
You will need Docker installed for this recipe. You will also need to know your processor architecture. If you don’t know it, just run docker info
and look for Architecture
:
$ docker info | grep Architecture
How to do it…
- Go to a repository on GitHub. You can create a new one or you can use the
GitHubActionsCookbook
repository, which you created in Chapter 1. Go to Settings | Actions | Runners (/settings/actions/runners
) and click on New self-hosted...