Skip to content

Using Project Configuration Files

Vitaliy Zakaznikov edited this page Apr 5, 2025 · 1 revision

Using Project Configuration Files

The -p/--project option allows you to specify a project configuration file that contains settings for a specific GitHub repository. This feature is particularly useful when you need to manage multiple runner projects, as each service instance can only handle one repository at a time and group runners are not supported.

Overview

Project configuration files provide a way to: * Manage multiple runner projects with different settings * Keep repository-specific configurations separate * Easily switch between different project configurations * Maintain clean separation of concerns for different repositories

Usage

To use a project configuration file, specify it using the -p or --project option:

github-hetzner-runners -p my-project.yaml

The project configuration file should contain all the necessary settings for your specific repository, including: * GitHub repository * Runner type * Location * Network settings * SSH keys * And other repository-specific configurations

Example

Here's an example of a project configuration file:

github:
  repository: "my-org/my-repo"
  token: "ghp_xxxxxxxxxxxxxxxxxxxx"
hetzner:
  token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
runner:
  type: "cx22"
  location: "fsn1"
  network: "default"
ssh:
  key: "~/.ssh/id_rsa.pub"

Benefits

Using project configuration files offers several advantages:

  • Isolation: Each repository's configuration is kept separate and isolated
  • Flexibility: Easy to switch between different project configurations
  • Maintainability: Configuration changes for one repository don't affect others
  • Organization: Better organization of runner settings across multiple projects
  • Version Control: Project configurations can be version controlled separately

Limitations

  • Each service instance can only handle one repository at a time
  • Group runners are not supported
  • Project configurations cannot override certain global settings

Best Practices

  • Keep project configuration files in a dedicated directory
  • Use meaningful names for configuration files
  • Document any special settings or requirements
  • Version control your project configurations
  • Regularly review and update configurations as needed
Clone this wiki locally