Repository configuration
RunsOn supports describing various options through a configuration file. This file is located at .github/runs-on.yml
(must be named exactly that) in the repository where you are using RunsOn runners.
The configuration file supports defining:
- custom images
- custom runners
- the list of admins having SSH access to the runners
Structure
The configuration file is a YAML file with the following structure:
_extends
If set, the configuration file will inherit from the configuration file in the repository specified by the _extends
value.
A common use case is to define a global configuration file in the .github-private
repository of your organization, and then inherit from it in other repositories. Do not forget to allow the RunsOn GitHub App to access the repository hosting the global configuration file.
Example:
In this example, the configuration file in the repository will inherit from the configuration file stored at .github/runs-on.yml
in the .github-private
repository.
runners
Mapping of runner names to runner configuration.
Configuration options available are the same as the job-level labels, but with the additional preinstall
option available (see example below):
cpu
: array of integers.ram
: array of integers.disk
: string.family
: array of strings.spot
: boolean or string.image
: string.ssh
: boolean.extras
: array of strings.private
: boolean.retry
: string.preinstall
: string. Script to run on the runner, before the GitHub Actions runner agent is executed.
Example:
And the runner will be available for use in the repository:
images
Mapping of image names to image configuration.
Available configuration options:
name
: string. Can include wildcards, in which case RunsOn will pick the most recent image matching the pattern.ami
: string. If set, the image will be pinned to the specified AMI, irrespective of thename
option.platform
: string.arch
: string.owner
: string.preinstall
: string. Script to run on the runner, before the GitHub Actions runner agent is executed. Takes precedence over thepreinstall
option at the runner level if both are set.tags
: mapping of key-value tags to filter the image when searching for it.
And you can use the image in your workflows like this:
admins
List of GitHub usernames that have SSH access to the runners launched for this repository. They come in addition to the admins defined at the CloudFormation stack level.
Example:
Full example
Using the configuration in a GitHub Workflow
Sharing configuration across repositories
RunsOn comes with a feature that allows a local configuration file to inherit from a globally defined configuration file, by using the _extends
directive.
The recommendation is to store the global configuration file in the special .github-private
repository of your organization, but you can choose any other repository as well (public or private).
Example: