공부/Git

[Github Action Runner] Self-Hosted Runner in Amazon Linux 2023

haejang 2023. 9. 17. 13:25
728x90
728x90

 

 

깃헙 액션 러너를 세팅하는 것은 매우 쉽다.

근데 amazon linux 2023 에서 진행하며, 공식 가이드에 있는것만으로는 부족해 남겨둔다.

 

먼저 토큰은 알아야 하므로... 깃헙 > Settings > Actions > Runners > New runner > New self-hosted runner 를 누른다.

그럼 이런 화면이 뜬다

 

이대로만 하면 중간에 

  • Shasum command not found
  • Libicu's dependencies is missing for Dotnet Core 6.0

라는 에러들을 보게 된다.

최종적으로는 아래와 같이만 하면 된다. (linux, x86 기준)

mkdir actions-runner && cd actions-runner
curl -o actions-runner-linux-x64-2.309.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.309.0/actions-runner-linux-x64-2.309.0.tar.gz

# install shasum
sudo yum install perl-Digest-SHA -y

echo "<HASH값>  actions-runner-linux-x64-2.309.0.tar.gz" | shasum -a 256 -c
tar xzf ./actions-runner-linux-x64-2.309.0.tar.gz

# install dependency
sudo yum install libicu -y

./config.sh --url <Github URL> --token <TOKEN>

# 백그라운드로 실행
nohup ./run.sh & > nohup.out

 

추가로, 러너에 특정 label을 추가하고 싶다면 config.sh 명령 시 --labels <추가 label 1>,<추가 label 2> 요렇게 넣어주면 된다.

 

끝!

 

 

728x90
728x90