{"meta":{"title":"ワークフローでの Actions Runner Controller ランナーの使用","intro":"ワークフローファイルで Actions Runner Controller ランナーを使用する。","product":"GitHub Actions","breadcrumbs":[{"href":"/ja/actions","title":"GitHub Actions"},{"href":"/ja/actions/how-tos","title":"方法"},{"href":"/ja/actions/how-tos/manage-runners","title":"ランナーを管理する"},{"href":"/ja/actions/how-tos/manage-runners/use-actions-runner-controller","title":"アクション ランナー コントローラー"},{"href":"/ja/actions/how-tos/manage-runners/use-actions-runner-controller/use-arc-in-a-workflow","title":"ワークフローで ARC を使用する"}],"documentType":"article"},"body":"# ワークフローでの Actions Runner Controller ランナーの使用\n\nワークフローファイルで Actions Runner Controller ランナーを使用する。\n\n## ワークフロー ファイルで ARC ランナーを使用する\n\nランナー スケール セットで実行するジョブを割り当てるには、スケール セットの名前を、`runs-on` ワークフロー ファイルのGitHub Actions キーの値として指定できます。\n\nたとえば、ランナー スケール セットの次の構成では、`INSTALLATION_NAME` 値が `arc-runner-set` に設定されています。\n\n```bash\n# Using a Personal Access Token (PAT)\nINSTALLATION_NAME=\"arc-runner-set\"\nNAMESPACE=\"arc-runners\"\nGITHUB_CONFIG_URL=\"https://github.com/<your_enterprise/org/repo>\"\nGITHUB_PAT=\"<PAT>\"\nhelm install \"${INSTALLATION_NAME}\" \\\n    --namespace \"${NAMESPACE}\" \\\n    --create-namespace \\\n    --set githubConfigUrl=\"${GITHUB_CONFIG_URL}\" \\\n    --set githubConfigSecret.github_token=\"${GITHUB_PAT}\" \\\n    oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set\n```\n\nワークフローでこの構成を使用するには、次の例のように、ワークフロー内の `runs-on` キーの値を `arc-runner-set` に設定します。\n\n```yaml\njobs:\n  job_name:\n    runs-on: arc-runner-set\n```\n\n## ランナー スケール セット名の使用\n\nランナー スケール セット名は、属するランナー グループ内で一意です。 同じ名前の複数のランナー スケール セットをデプロイするには、それらが異なるランナー グループに属している必要があります。 ランナー スケール セット名の指定の詳細については、「[アクション ランナー コントローラーを使用してランナー スケール セットをデプロイする](/ja/actions/how-tos/manage-runners/use-actions-runner-controller/deploy-runner-scale-sets)」を参照してください。\n\nランナー スケール セットのインストール名を使用することも、`values.yaml` ファイル内の [](https://github.com/actions/actions-runner-controller/blob/master/charts/gha-runner-scale-set/values.yaml) フィールドの値を`runs-on`ターゲットとして定義することもできます。 スケール セットに複数のラベルを割り当てて、より柔軟なジョブ ルーティングを有効にすることもできます。 ランナー スケール セットのラベルを構成するには、`runnerScaleSetLabels` ファイルで`values.yaml`値を設定します。 詳細については、 [AUTOTITLE を](/ja/actions/how-tos/manage-runners/use-actions-runner-controller/deploy-runner-scale-sets)参照してください。\n\n## ラベルを使用してランナー スケール セットをターゲットにする\n\nまた、ランナー スケール セットに複数のラベルを割り当てて、それらを使用してワークフロー内のランナーをターゲットにすることもできます。 ランナー スケール セットのラベルを構成するには、`runnerScaleSetLabels` ファイルで`values.yaml`値を設定します。\n\n```yaml\nrunnerScaleSetLabels:\n  - linux\n  - gpu\n  - private-network\n```\n\n特定のラベルを持つランナー スケール セットをターゲットにするには、ワークフローの `runs-on` キーでラベルを配列として指定します。\n\n```yaml\njobs:\n  job_name:\n    runs-on: [linux, gpu, private-network]\n```\n\n## 法務上の通知\n\nApache-2.0 ライセンスのもとで <https://github.com/actions/actions-runner-controller/> から一部を引用しています。\n\n```text\nCopyright 2019 Moto Ishizawa\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```"}