Interview Prep/GitHub Actions/Caching, Artifacts, Runners & ARC

How does a self-hosted runner register and get work?

IntermediateConceptCaching, Artifacts, Runners & ARC
Answer
mkdir actions-runner && cd actions-runner
curl -o runner.tar.gz -L https://github.com/actions/runner/releases/download/v2.329.0/actions-runner-linux-x64-2.329.0.tar.gz
tar xzf runner.tar.gz
./config.sh --url https://github.com/ORG --token "$REG_TOKEN" \
  --labels linux,x64,build --runnergroup build --ephemeral --unattended
sudo ./svc.sh install && sudo ./svc.sh start   # or ./run.sh

The registration token (valid one hour) is exchanged for runner credentials. The runner then opens an outbound HTTPS long poll to GitHub; no inbound ports are needed. Check the latest version on the releases page, because runners that fall too far behind are refused.

All GitHub Actions questions Roadmap: GitHub Actions

More on Caching, Artifacts, Runners & ARC