Skip to content

jameswsullivan/github-self-hosted-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Containerized Self-hosted GitHub Actions Runner

Instructions

Build image

  • Make a copy of the example-build.sh and name it to build.sh, and modify the ACTIONS_RUNNER_IMAGE_TAG and ACTIONS_RUNNER_IMAGE_FULL_TAG variables as needed.
  • Login to your docker registry before running the script.
  • Run the build.sh to build and push your actions-runner image.

Configurations

The following environment variables should be supplied. These information could be found from:

Your GitHub Repo --> Settings --> Actions --> Runners --> New self-hosted runner --> Choose Linux

e.g. :

For repo https://github.com/jameswsullivan/mysamplerepo , the following information can be found under the Download and Configure sections :

Download

curl -o actions-runner-linux-x64-2.320.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.320.0/actions-runner-linux-x64-2.320.0.tar.gz

Configure

./config.sh --url https://github.com/jameswsullivan/mysamplerepo --token ABCDEFGHIJKLMNOPQRSTUVWXYZABC

The environment variables would then be configured as follows :

ENV GITHUB_REPO_URL="https://github.com/jameswsullivan/mysamplerepo"
ENV GITHUB_REPO_TOKEN="ABCDEFGHIJKLMNOPQRSTUVWXYZABC"
ENV ACTIONS_RUNNER_INSTALL_FILENAME="actions-runner-linux-x64-2.320.0.tar.gz"
ENV ACTIONS_RUNNER_DOWNLOAD_URL="https://github.com/actions/runner/releases/download/v2.320.0/actions-runner-linux-x64-2.320.0.tar.gz"

ENV GITHUB_RUNNER_GROUP=""
ENV GITHUB_RUNNER_NAME="mysamplerepo-runner"
ENV GITHUB_RUNNER_LABELS=""
ENV GITHUB_RUNNER_WORK_FOLDER=""

Start and run the actions-runner

  • Upon first startup, run the container with tail -f /dev/null and run the /opt/actions-runner-scripts/install-runner.sh script manually to install and configure the actions-runner, or start the container with the /opt/actions-runner-scripts/install-runner.sh to install automatically.
  • After the runner has been configured, run the container with /opt/actions-runner-scripts/entrypoint.sh to start the runner.

Note

  • A persistent volume can be mounted at /opt/actions-runner to persist file changes, and has to be writable by user runner or 3001 .

About

Containerized GitHub self-hosted runner for Rancher/Kubernetes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published