GitHub Actions のランナーとは?
ランナーはジョブのステップを実際に実行するサーバーです。ランナーアプリケーションが GitHub をポーリングして作業を取得し実行します。
workflow は作業を記述しますが、それを実行する何かが必要です。それがランナーです。GitHub Actions のランナーエージェントがインストールされ、ジョブを取得する準備ができた仮想マシンまたはコンテナです。
それは何か
ランナーは Actions のランナーソフトウェアを実行するマシンです。ジョブがキューに入ると、ジョブのラベルに一致する利用可能なランナーがそれを取得し、すべてのステップを実行し、ログを GitHub にストリームバックします。
Selecting a runner
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "Running on ${{ runner.os }}"どう動くか
runs-on: フィールドがどのランナータイプでジョブを実行するかを選択します。GitHub ホストランナーはジョブごとに新しく起動され、セルフホストランナーはあなたが保守しリポジトリや組織に登録するマシンです。
3 つの種類
- GitHub ホスト: 分単位で課金されるマネージド VM。
- セルフホスト: あなた自身のハードウェアまたはクラウドインスタンス。
- マネージド: サードパーティがフリートを運用してくれます。
なぜ重要か
ランナーの選択はコスト、速度、コントロールを左右します。Latchkey は GitHub ホストランナーとまったく同じ workflow を実行するマネージドランナーを提供しますが、より安価で自己修復するため、失敗したインスタンスは自動的に置き換えられます。
関連する概念
ランナーは runs-on: とラベルで選択され、セルフホストのフリートは runner group に整理できます。
重要なポイント
- ランナーはジョブを実行するマシンです。
runs-on:はラベルでランナーを選択します。- 選択肢は GitHub ホスト、セルフホスト、マネージドです。
関連ガイド
What Is a Self-Hosted Runner in GitHub Actions?A self-hosted runner is a machine you own and register to GitHub to run Actions jobs, giving control over har…
What Is a Runner Label in GitHub Actions?A runner label is a tag on a runner that jobs match in runs-on, letting you route work to runners with the ri…
What Is a Larger Runner in GitHub Actions?A larger runner is a GitHub-hosted runner with more CPU, memory, or a GPU than standard runners, used for hea…
What Is a Job in GitHub Actions?A job in GitHub Actions is a group of steps that runs on a single runner. Jobs run in parallel by default and…