Provision a ubuntu server.
The next steps will be running on the ubuntu server.
curl -fsSL https://raw.githubusercontent.com/ycio/add-self-hosted-runner-to-github-actions/main/install-packages.sh | bashcurl -fsSL https://raw.githubusercontent.com/ycio/add-self-hosted-runner-to-github-actions/main/install-docker.sh | bashAdd a cron job to clean up docker with crontab -e.e.g:
echo "0 0 * * * docker system prune -f" | crontab -
adduser --disabled-password --gecos "" ci
usermod -aG sudo ci
usermod -aG docker ci
newgrp docker
mkdir -p /etc/sudoers.d/ci
echo 'ci ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers.d/ci
Swich to user ci with the following command:
su ci
cd
Follow the document to add the self-hosted runner.
Follow the instructions to run the runner as a service.