2. Go to Actions --> Runners --> New self-hoster runner:
3. Follow the instructions for the os in question (most likely Linux)
4. Use the following:
Copy # Use this YAML in your workflow file for each job
runs-on : self-hosted
To run the runner you have 2 options:
Copy user@linux-01:~/actions-runner$ sudo ./svc.sh
Usage:
./svc.sh [install, start, stop, status, uninstall]
Commands:
install [user]: Install runner service as Root or specified user.
start: Manually start the runner service.
stop: Manually stop the runner service.
status: Display status of runner service.
uninstall: Uninstall runner service.
Copy user@linux-01:~/actions-runner$ sudo ./svc.sh install
Creating launch runner in /etc/systemd/system/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service
Run as user: tech
Run as uid: 1000
gid: 100
Created symlink /etc/systemd/system/multi-user.target.wants/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service → /etc/systemd/system/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service.
Copy user@linux-01:~/actions-runner$ sudo ./svc.sh start
/etc/systemd/system/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service
● actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service - GitHub Actions Runner (Atredies-sturdy-octo-fiesta.vor-01)
Loaded: loaded (/etc/systemd/system/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service; enabled ; vendor preset: enabled )
Active: active (running) since Sun 2022-01-30 19:22:33 EET; 12ms ago
Main PID: 913 (runsvc.sh)
Tasks: 3 (limit: 1133 )
Memory: 948.0K
CPU: 4ms
CGroup: /system.slice/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service
├─913 /bin/bash /home/tech/actions-runner/runsvc.sh
└─915 ./externals/node12/bin/node ./bin/RunnerService.js
Jan 30 19:22:33 linux-01 systemd[1]: Started GitHub Actions Runner (Atredies-sturdy-octo…r-01).
Jan 30 19:22:33 linux-01 runsvc.sh[913]: .path=/usr/local/bin:/usr/bin:/bin:/usr/local/ga…games
Hint: Some lines were ellipsized, use -l to show in full.
Copy user@linux-01:~/actions-runner$ sudo ./svc.sh status
/etc/systemd/system/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service
● actions.runner.Atredies-sturdy-octo-fiesta.linux-01.service - GitHub Actions Runner (Atredies-sturdy-octo-fiesta.vor-01)
Loaded: loaded (/etc/systemd/system/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service; enabled ; vendor preset: enabled )
Active: active (running) since Sun 2022-01-30 19:22:33 EET; 4s ago
Main PID: 913 (runsvc.sh)
Tasks: 21 (limit: 1133 )
Memory: 36.4M
CPU: 790ms
CGroup: /system.slice/actions.runner.Atredies-sturdy-octo-fiesta.vor-01.service
├─913 /bin/bash /home/tech/actions-runner/runsvc.sh
├─915 ./externals/node12/bin/node ./bin/RunnerService.js
└─924 /home/tech/actions-runner/bin/Runner.Listener run --startuptype service
Jan 30 19:22:33 linux-01 systemd[1]: Started GitHub Actions Runner (Atredies-sturdy-octo…r-01).
Jan 30 19:22:33 linux-01 runsvc.sh[913]: .path=/usr/local/bin:/usr/bin:/bin:/usr/local/ga…games
Jan 30 19:22:33 linux-01 runsvc.sh[915]: Starting Runner listener with startup type: service
Jan 30 19:22:33 linux-01 runsvc.sh[915]: Started listener process, pid: 924
Jan 30 19:22:33 linux-01 runsvc.sh[915]: Started running service
Jan 30 19:22:34 linux-01 runsvc.sh[915]: √ Connected to GitHub
Jan 30 19:22:35 linux-01 runsvc.sh[915]: Current runner version: '2.286.1'
Jan 30 19:22:35 linux-01 runsvc.sh[915]: 2022-01-30 17:22:35Z: Listening for Jobs
Hint: Some lines were ellipsized, use -l to show in full.