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.
More on Caching, Artifacts, Runners & ARC
How does `actions/cache` match keys and restore keys?IntermediateWhich caches can a branch restore from?AdvancedWhat are the cache size limits and eviction rules?BeginnerWhen should you use setup-* built-in caching instead of `actions/cache`?BeginnerWhy cache the package manager's download cache rather than `node_modules`?AdvancedHow do `actions/cache/restore` and `actions/cache/save` help?Advanced