This project provides a self-hosted runner for GitHub Actions equiped with nodejs and npm, designed to be run on a VPS (Virtual Private Server). Using a self-hosted runner offers several advantages:
- Network privileges
- Fixed IP address
- Cost-effective solution (it's free! 😄)
Before you begin, ensure you have the following:
- Docker and Docker Compose installed on your VPS
- A GitHub account with appropriate permissions to set up runners
You'll need to set the following environment variables:
GITHUB_PAT: Personal Access Token for GitHubGITHUB_OWNER: The GitHub username or organization nameGITHUB_REPO: The name of the repository where you want to use this runner
To start the runner(s), follow these steps:
-
Clone this repository to your VPS.
-
Navigate to the project directory.
-
Set the required environment variables (see above).
-
Use the following Docker Compose command to build and start the runners:
docker-compose up --build -d --scale runner=<number_of_runners>
Replace
<number_of_runners>with the desired number of runner instances. For example, to start 3 runners:docker-compose up --build -d --scale runner=3
To use this runner in the specified repo, inside the workflow file use:
runs-on: self-hostedIn each job you want to be performed by the self hosted runner.