# Self Hosted Runner

참고 : [https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners)

## 설치

Setting >> GitHub >> Action >> runners

![alt text](https://3379277180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MaoWGMVdC3ztoOAzHPq%2Fuploads%2Fgit-blob-55e4421bf5addd495df159d6a8a0b3bba921125a%2Fimage.png?alt=media)

click "new self hosted runner"

![alt text](https://3379277180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MaoWGMVdC3ztoOAzHPq%2Fuploads%2Fgit-blob-08fd061bc48243db02d286e9c6cef314cc3d4950%2Fimage-1.png?alt=media)

select os and Architecture

![alt text](https://3379277180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MaoWGMVdC3ztoOAzHPq%2Fuploads%2Fgit-blob-cb46305228e7212f39752f3aaf2646364111c8d6%2Fimage-2.png?alt=media)

```sh
# Create a folder
mkdir actions-runner && cd actions-runner # Download the latest runner package
curl -o actions-runner-osx-x64-2.313.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.313.0/actions-runner-osx-x64-2.313.0.tar.gz
tar xzf ./actions-runner-osx-x64-2.313.0.tar.gz
```

![alt text](https://3379277180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MaoWGMVdC3ztoOAzHPq%2Fuploads%2Fgit-blob-76a5f37e6be2a69725481a239a0dfae7f3ae4121%2Fimage-3.png?alt=media)

## configure

```sh
./config.sh --url https://github.com/teamsmiley/gitbook-sample --token ABFUT65NGHFYDSAH6RWM2KDF23HHA
```

![alt text](https://3379277180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MaoWGMVdC3ztoOAzHPq%2Fuploads%2Fgit-blob-66e83745f378f11d2fd04ab20dc5aa9d7d962e7e%2Fimage-4.png?alt=media)

다시 github에서 setting >> Actions >> runners로 가면 등록된 runner가 보인다.

![alt text](https://3379277180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MaoWGMVdC3ztoOAzHPq%2Fuploads%2Fgit-blob-8f6829f39291086ec815bb4b7103d37a816049de%2Fimage-5.png?alt=media)

```sh
./run.sh
```

이제 idle 상태가 된다.

## 사용

runs-on을 사용하면 된다.

```yaml
runs-on: self-hosted
```

## 결론

ios빌드나 code signing등을 위해서는 self-hosted runner를 사용할수 있다.
