Replace Github runner by self hosted runner - ji-it/CloudTides GitHub Wiki

Step1: Enable self-hosted runner

  • To add a self-hosted runner to a user repository, you must be the repository owner

  • Open settings-Actions and click Add Runner

image-20200722082504183

  • Choose the right os and arch

image-20200722102855633

Step2: Add self-hosted runner in your own server

  • If you want to run workflows that use Docker container actions or service containers, you must use a Linux machine and Docker must be installed.
  • Configuration must not run with sudo or root user
  • Use the repo name and token got from the previous step
useradd runner
su runner

mkdir -p /home/runner/actions-runner && cd /home/runner/actions-runner
curl -O -L https://github.com/actions/runner/releases/download/v2.267.1/actions-runner-linux-x64-2.267.1.tar.gz
tar xzf ./actions-runner-linux-x64-2.267.1.tar.gz

# use the repo name and token got from the previous step
./config.sh --url https://github.com/<path/to/repo> --token <token>
./run.sh

image-20200722111011762

  • To use systemd daemon, make sure your system has systemd
su 
./svc.sh install
./svc.sh start

image-20200722111023680

  • Then you can see the runner is registered successfully

image-20200722103710416

Step3: Modify your workflow files

  • replace runs-on: ubuntu-latest by runs-on: self-hosted of the workflow files

image-20200722104155548

⚠️ **GitHub.com Fallback** ⚠️