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.
Before following this, make sure you have the prerequisites installed/fulfilled:
Next, clone the repository and follow the steps below.
git clone https://github.com/hasithaishere/github-runner
Then you can go the project root directory and execute build command
cd github-runner
sh build.sh <Docker Hub User Name> <Docker Hub User Password> <OS Name> <OS Version>
If you only want to run this in locally, so please ignore
Docker Hub User Name
andDocker Hub User Password
arguments.
In this version this build script only support ubuntu based docker base images, os
OS Name
variable should beubuntu
andOS Vesrion
need to be basic ubuntu version ex-20.04
or22.04
This you can run following docker command and see the build images in locally.
docker images
However if you don't want to build the container locally you can directly pull the image from Docker Hub using following command.
docker pull hasithaishere/github-runner
OR
docker pull hasithaishere/github-runner:tag
Initially you have to generate custom access token for connect your self-hosted runner to GitHub account.
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.
#Run container from image:
docker run -e GH_TOKEN='<Your GitHub Token>' -e GH_OWNER='<Organization name/ your user name>' -e GH_REPOSITORY='<Repository Name>' -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.