Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reuse Github Actions self hosted runner on multiple repositories

I have a Self-Hosted Github Actions runner running on my server for 1 of my repositories. But now I want to use that same runner for an other repo.

Is there a way that I can reuse that same Github Actions runner for an other repo without the need of creating a new runner?

like image 501
Mike Brouwer Avatar asked Dec 01 '19 19:12

Mike Brouwer


People also ask

Is GitHub action self-hosted runner free?

GitHub Actions usage is free for standard GitHub-hosted runners in public repositories, and for self-hosted runners. For private repositories, each GitHub account receives a certain amount of free minutes and storage for use with GitHub-hosted runners, depending on the product used with the account.

How do I use self-hosted runner in GitHub action?

To use self-hosted runners in a workflow, you can use labels to specify the runner type for a job. For information on creating custom and default labels, see "Using labels with self-hosted runners."

Are GitHub Actions self-hosted?

Your runner machine connects to GitHub using the GitHub Actions self-hosted runner application. The GitHub Actions runner application is open source. You can contribute and file issues in the runner repository.

What is GitHub runner group?

Runner groups are used to control access to runners at the organization and enterprise level. Enterprise owners can configure access policies that control which organizations in an enterprise have access to the runner group.


2 Answers

Update:

This is possible as of 22nd of April 2020. You can now share runners across an organization. This allows for repositories within your organization to use those runners.

https://github.blog/2020-04-22-github-actions-community-momentum-enterprise-capabilities-and-developer-improvements/#share-self-hosted-runners-across-an-organization

Old Answer:

This is not possible as of yet, according to a Github Partner:

Currently, we have no methods to use the self-hosted runners across repositories, and also have no options to added self-hosted runners on Organization level.

Source: https://github.community/t5/GitHub-Actions/Can-one-Github-Actions-self-hosted-runner-work-for-multiple/td-p/41465

like image 96
Steven Avatar answered Sep 28 '22 02:09

Steven


We're using auto-scaled self-hosted github action runners on AWS spot instances.

We've open-sourced it: https://github.com/philips-labs/terraform-aws-github-runner

One of its creators make a blog post about it with some information about the workings: https://040code.github.io/2020/05/25/scaling-selfhosted-action-runners

Once a runner is active it can pick up multiple builds from various repositories. After a while, the idle runners are terminated. When a new workflow is triggered, a github app will create a new runner and that runner will pick up the work.

like image 33
JeroenKnoops Avatar answered Sep 28 '22 02:09

JeroenKnoops