我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

Adding self-hosted runners

You can add a self-hosted runner to a repository to run jobs in a workflow.

To add a self-hosted runner to a user repository, you must be the repository owner. For an organization repository, you must be an organization owner or have admin access to the repository.

For information on supported operating systems for self-hosted runners, or using self-hosted runners with a proxy server, see "About self-hosted runners."

Warning: 建议不要将自托管运行器用于公共仓库。

通过创建在工作流程中执行代码的拉取请求,公共仓库的复刻可能会在您的自托管运行器上运行危险代码。

For more information, see "About self-hosted runners."

  1. 在 GitHub 上,导航到仓库的主页面。

  2. 在仓库名称下,单击 Settings(设置)

    仓库设置按钮

  3. 在左侧边栏中,单击 Actions(操作)

    操作设置

  4. Next to "Self-hosted runners", click Add runner.

    Add runner button

  5. Select the operating system of your self-hosted runner machine.

    Select self-hosted runner operating system

  6. If you are using Linux, use the drop-down menu to select the architecture of your self-hosted runner machine.

    Select self-hosted runner architecture

  7. You will see instructions showing you how to download the runner application and install it on your self-hosted runner machine.

    Open a shell on your self-hosted runner machine and run each shell command in the order shown.

    Note: On Windows, if you want to install the runner application as a service, you must open a shell with administrator privileges. We also recommend that you use C:\actions-runner as the directory for the runner application so that Windows system accounts can access the runner directory.

    The instructions walk you through completing these tasks:

    • Downloading and extracting the self-hosted runner application.
    • Running the config script to configure the runner application and register it with your GitHub repository. The config script requires the repository URL and an automatically-generated time-limited token to authenticate the request.

    • Running the runner application to connect the machine to GitHub 操作.

After completing the steps to add a self-hosted runner, the runner and its status are now listed under "Self-hosted runners".

Self-hosted runner list

The runner application must be active for the runner to accept jobs. When the runner application is connected to GitHub and ready to receive jobs, you will see the following message on machine's terminal.

√ 已连接到 GitHub

2019-10-24 05:45:56Z: 正在监听作业

For more information, see "Checking the status of self-hosted runners."

问问别人

找不到要找的内容?

联系我们