A self hosted github action runner, allows you to run the github actions locally on your machine, instead of github hosted servers.
Use case: For example,
- You have a local database setup with data, and want to test the data. In that case, a self hosted runner would be helpful.
- You have some local docker private images present in your infrastructure, then a self hosted runner would be helpful.
How to setup?
Start by creating an empty repository in github, and go to
Settings > Actions > Runners
And, click on
New self-hosted runner button. It will open a new page with all the instruction for different kind of operating systems.
As I am on
Ubuntu operating system, so I choose
Linux as os, and architecture as
Now, to start the runner consists of steps:
- Create a folder to store the runner binary and download it from GitHub.
# Create a folder
$ mkdir actions-runner && cd actions-runner # Download the latest runner package
$ curl -o actions-runner-linux-x64-2.304.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.304.0/actions-runner-linux-x64-2.304.0.tar.gz# Optional: Validate the hash
$ echo "292e8770bdeafca135c2c06cd5426f9dda49a775568f45fcc25cc2b576afc12f actions-runner-linux-x64-2.304.0.tar.gz" | shasum -a 256 -c# Extract the installer
$ tar xzf ./actions-runner-linux-x64-2.304.0.tar.gz
The above steps will compare the hash values of downloaded binary with the value for successful download. Once it is successfully downloaded, it will extract in same folder.
$ echo "292e8770bdeafca135c2c06cd5426f9dda49a775568f45fcc25cc2b576afc12f actions-runner-linux-x64-2.304.0.tar.gz" | shasum -a 256 -c