Github Actions의 runner 개념 및 self-hosted runner 설치 방법 정리
이전에 사용해본 gitlab runner와 비슷한 개념
runner가 서버에서 대기 상태로 있다가 선언된 트리거가 작동되면 workflow를 실행한다.
Github Actions에는 크게 2 종류의 runner가 존재한다.
NCP > centos 7.8
# Create a folder under the drive root
mkdir actions-runner && cd actions-runner
# Download the latest runner package
curl -o actions-runner-linux-x64-2.299.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.299.1/actions-runner-linux-x64-2.299.1.tar.gz
# Optional: Validate the hash
echo "147c14700c6cb997(중략)ee88ead6fe73a72c74 actions-runner-linux-x64-2.299.1.tar.gz" | shasum -a 256 -c
# shasum 명령어 실행이 안 될 경우
sudo yum install perl-Digest-SHA -y
# Extract the installer
.tar xzf ./actions-runner-linux-x64-2.299.1.tar.gz.
[admin@dt-dpr actions-runner]$ sudo ./bin/installdependencies.sh
--------OS Information--------
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
....
[admin@dt-dpr actions-runner]$ ./config.sh --url https://github.com/zzuckerfrei/tutorial_actions --token {token}
--------------------------------------------------------------------------------
| ____ _ _ _ _ _ _ _ _ |
| / ___(_) |_| | | |_ _| |__ / \ ___| |_(_) ___ _ __ ___ |
| | | _| | __| |_| | | | | '_ \ / _ \ / __| __| |/ _ \| '_ \/ __| |
| | |_| | | |_| _ | |_| | |_) | / ___ \ (__| |_| | (_) | | | \__ \ |
| \____|_|\__|_| |_|\__,_|_.__/ /_/ \_\___|\__|_|\___/|_| |_|___/ |
| |
| Self-hosted runner registration |
| |
--------------------------------------------------------------------------------
# Authentication
√ Connected to GitHub
# Runner Registration
Enter the name of the runner group to add this runner to: [press Enter for Default]
Enter the name of runner: [press Enter for dt-dpr] tuto
This runner will have the following labels: 'self-hosted', 'Linux', 'X64'
Enter any additional labels (ex. label-1,label-2): [press Enter to skip]
√ Runner successfully added
√ Runner connection is good
# Runner settings
Enter name of work folder: [press Enter for _work]
√ Settings Saved.
[admin@dt-dpr actions-runner]$ ./run.sh
√ Connected to GitHub
Current runner version: '2.299.1'
2023-01-06 05:59:06Z: Listening for Jobs
[admin@dt-dpr actions-runner]$ nohup ./run.sh & > nohup.out
[1] 55178
[admin@dt-dpr actions-runner]$ nohup: ignoring input and appending output to ‘nohup.out’
./config.sh remove --token {token}
다음 포스팅에서는 Github Actions workflow 파일 작성을 정리해야겠다.