- Make a copy of the
example-build.shand name it tobuild.sh, and modify theACTIONS_RUNNER_IMAGE_TAGandACTIONS_RUNNER_IMAGE_FULL_TAGvariables as needed. - Login to your docker registry before running the script.
- Run the
build.shto build and push your actions-runner image.
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=""
- Upon first startup, run the container with
tail -f /dev/nulland run the/opt/actions-runner-scripts/install-runner.shscript manually to install and configure the actions-runner, or start the container with the/opt/actions-runner-scripts/install-runner.shto install automatically. - After the runner has been configured, run the container with
/opt/actions-runner-scripts/entrypoint.shto start the runner.
- A persistent volume can be mounted at
/opt/actions-runnerto persist file changes, and has to be writable by userrunneror3001.