Skip to main content

在工作流中使用 Actions Runner Controller 运行器

可以在工作流文件中使用 Actions Runner Controller 运行器。

法律通告

关于在工作流文件中使用 ARC 运行器

若要分配要在运行器规模集上运行的作业,可以将规模集名称指定为 GitHub Actions 工作流文件中 runs-on 键的值。

例如,运行器规模集的以下配置将 INSTALLATION_NAME 值设置为 arc-runner-set

# Using a Personal Access Token (PAT)
INSTALLATION_NAME="arc-runner-set"
NAMESPACE="arc-runners"
GITHUB_CONFIG_URL="https://github.com/<your_enterprise/org/repo>"
GITHUB_PAT="<PAT>"
helm install "${INSTALLATION_NAME}" \
    --namespace "${NAMESPACE}" \
    --create-namespace \
    --set githubConfigUrl="${GITHUB_CONFIG_URL}" \
    --set githubConfigSecret.github_token="${GITHUB_PAT}" \
    oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set

若要在工作流中使用此配置,请将工作流中 runs-on 键的值设置为 arc-runner-set,如以下示例所示。

jobs:
  job_name:
    runs-on: arc-runner-set

使用运行器规模集名称

运行器规模集名称在其所属的运行器组中是唯一的。 若要部署多个同名的运行器规模集,它们必须属于不同的运行器组。 若要详细了解如何指定运行器规模集名称,请参阅“使用 Actions Runner Controller 部署运行器规模集”。

不能使用其他标签来定位 ARC 创建的运行器。 只能使用在安装期间指定的运行器规模集的安装名称,或者是在 values.yaml 文件中定义 runnerScaleSetName 字段的值。 这些标签用作“单一标签”,用作 runs-on 目标。 有关详细信息,请参阅“使用 Actions Runner Controller 部署运行器规模集”。

部分内容改编自 Apache-2.0 许可证下的 https://github.com/actions/actions-runner-controller/

Copyright 2019 Moto Ishizawa

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.