Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hasithaishere/github-runner
Docker Based Custom (Self-Hosted) Github Runner
https://github.com/hasithaishere/github-runner
docker github-runner github-runners gtihub-actions self-hosted self-hosted-runner
Last synced: 17 days ago
JSON representation
Docker Based Custom (Self-Hosted) Github Runner
- Host: GitHub
- URL: https://github.com/hasithaishere/github-runner
- Owner: hasithaishere
- License: mit
- Created: 2022-10-09T08:12:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-10T12:04:29.000Z (over 2 years ago)
- Last Synced: 2024-11-10T11:40:42.597Z (2 months ago)
- Topics: docker, github-runner, github-runners, gtihub-actions, self-hosted, self-hosted-runner
- Language: Shell
- Homepage: https://hub.docker.com/r/hasithaishere/github-runner
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
GitHub Runner
Generally, Github provides free 2000 build minutes in an every month. You can use these build minutes for your personal or any other business purposes. However, sometimes that isn't enough. You might need more build minutes, which is where we come in.
In this project, we build a general purpose GitHub custom runner using Docker. So you can use these docker image to run your wn custom runner in any of your cloud provider or locally without any complexity.
## Steps for building container locally
Before following this, make sure you have the prerequisites installed/fulfilled:
- [Git](https://git-scm.com/downloads)
- [Docker](https://docs.docker.com/get-docker/)Next, clone the repository and follow the steps below.
```shell
git clone https://github.com/hasithaishere/github-runner
```Then you can go the project root directory and execute build command
```shell
cd github-runner
sh build.sh
```>If you only want to run this in locally, so please ignore `Docker Hub User Name` and `Docker Hub User Password` arguments.
>In this version this build script only support ubuntu based docker base images, os `OS Name` variable should be `ubuntu` and `OS Vesrion` need to be basic ubuntu version ex- `20.04` or `22.04`
This you can run following docker command and see the build images in locally.
```shell
docker images
```
## Pull image form Docker HubHowever if you don't want to build the container locally you can directly pull the image from Docker Hub using following command.
```shell
docker pull hasithaishere/github-runner
```
_**OR**_
```shell
docker pull hasithaishere/github-runner:tag
```## Connect Docker Runner with GitHub
Initially you have to generate custom access token for connect your self-hosted runner to GitHub account.
#### How to generate access token
Please follow these steps to generate custo access token.
- Click on your profile icon and click on the settings in the dropdown menu.
- Then go to **Developer Settings** and Click on the **Personal Access Token**.
- Click on the **Generate New Token** button.
- Then select following permissions from the list and generate the token.
- Please save your token in **safe place** before close the window. Because this token you can retrieve one time only.
Please execute following command to bind the local/ cloud based runner to GitHub.
#### Connect Runner With GitHub Account
```shell
#Run container from image:
docker run -e GH_TOKEN='' -e GH_OWNER='' -e GH_REPOSITORY='' -d hasithaishere/github-runner
```If container has been successfully started, you can see the runner in the running container list.
And also you can see the container in GitHub Action page's runners list.