(feat) Add app action-runner
This commit is contained in:
parent
6f59a31494
commit
5ff9375a90
|
|
@ -0,0 +1,77 @@
|
|||
additionalProperties:
|
||||
formFields:
|
||||
- default: "repos"
|
||||
edit: true
|
||||
envKey: ROLE
|
||||
labelEn: Role (Repository or Organization)
|
||||
labelZh: 角色 (个人仓库或者组织)
|
||||
required: true
|
||||
type: select
|
||||
values:
|
||||
- label: "个人仓库 Repository"
|
||||
value: "repos"
|
||||
- label: "企业 Enterprise"
|
||||
value: "enterprises"
|
||||
- label: "组织 Organization"
|
||||
value: "orgs"
|
||||
|
||||
- default: "owner/repo"
|
||||
edit: true
|
||||
envKey: REPO
|
||||
labelEn: Repository name or organization name
|
||||
labelZh: 仓库名或组织名
|
||||
required: true
|
||||
type: text
|
||||
|
||||
- default: ""
|
||||
edit: true
|
||||
envKey: GITHUB_TOKEN
|
||||
labelEn: Github Token
|
||||
labelZh: Github 令牌
|
||||
required: true
|
||||
type: text
|
||||
|
||||
- default: ""
|
||||
edit: true
|
||||
envKey: RUNNER_NAME
|
||||
labelEn: Runner Name
|
||||
labelZh: 运行器名称
|
||||
required: false
|
||||
type: text
|
||||
|
||||
- default: "label1,label2"
|
||||
edit: true
|
||||
envKey: RUNNER_LABELS
|
||||
labelEn: Runner Labels
|
||||
labelZh: 运行器标签
|
||||
required: false
|
||||
type: text
|
||||
|
||||
- default: "_work"
|
||||
edit: true
|
||||
envKey: WORK_FOLDER
|
||||
labelEn: Work Folder
|
||||
labelZh: 工作文件夹
|
||||
required: false
|
||||
type: text
|
||||
|
||||
- default: "Default"
|
||||
edit: true
|
||||
envKey: RUNNER_GROUP
|
||||
labelEn: Runner Group
|
||||
labelZh: 运行器组
|
||||
required: false
|
||||
type: text
|
||||
|
||||
- default: "false"
|
||||
edit: true
|
||||
envKey: AUTO_UNREGISTER
|
||||
labelEn: Unregister the Runner when the container is stopped
|
||||
labelZh: 是否在容器停止时注销 Runner
|
||||
required: false
|
||||
type: select
|
||||
values:
|
||||
- label: "True"
|
||||
value: "true"
|
||||
- label: "False"
|
||||
value: "false"
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
services:
|
||||
actions-runner:
|
||||
image: ghcr.io/pooneyy/actions-runner:2.328.0
|
||||
container_name: ${CONTAINER_NAME}
|
||||
restart: always
|
||||
privileged: true
|
||||
networks:
|
||||
- 1panel-network
|
||||
labels:
|
||||
createdBy: "Apps"
|
||||
environment:
|
||||
ROLE: ${ROLE}
|
||||
REPO: ${REPO}
|
||||
RUNNER_GITHUB_TOKEN: ${GITHUB_TOKEN}
|
||||
RUNNER_NAME: ${RUNNER_NAME}
|
||||
RUNNER_LABELS: ${RUNNER_LABELS}
|
||||
WORK_FOLDER: ${WORK_FOLDER}
|
||||
RUNNER_GROUP: ${RUNNER_GROUP}
|
||||
AUTO_UNREGISTER: ${AUTO_UNREGISTER}
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./config:/home/runner/.runner_config
|
||||
|
||||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# Github Action Runner
|
||||
|
||||

|
||||
|
||||
运行在容器中的简单的自托管 GitHub Actions 运行器
|
||||
|
||||
## 功能
|
||||
|
||||
- 支持 Docker-in-Docker
|
||||
|
||||
### 环境变量
|
||||
| 参数 | 是否必须 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `ROLE` | 必须 | 用于区分企业、组织与个人仓库<br/>企业为 `enterprises` 组织为 `orgs` ,个人仓库为 `repos`<br/>**REST API** |
|
||||
| `REPO` | 必须 | 企业格式为`enterpriseName`<br/>组织格式为`orgName`<br/>个人仓库格式为 `owner/repo`<br/>**REST API** |
|
||||
| `RUNNER_GITHUB_TOKEN` | 必须 | [推荐 Fine-grained PAT](https://github.com/settings/personal-access-tokens/new)。<br />对于企业:<br />**Fine-grained PAT 不能用于企业**<br />OAuth 应用令牌和PAT(classic)需要 `manage_runners:enterprise` 权限。<br />对于组织:<br/>应具备 Self-hosted runners 的读写权限。<br />OAuth 令牌和PAT(classic)需要 `admin:org` 权限,<br />此外私有组织仓库还需要 `repo` 权限。<br />对于个人仓库:<br/>应具备 Administration 的读写权限。<br />OAuth 令牌和PAT(classic)需要 `repo` 权限。<br />[如何创建令牌?](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)<br />**REST API** |
|
||||
| `RUNNER_NAME` | | Runner 名称,留空随机生成。<br />在同一个个人仓库(或企业、组织)中 Runner 名称不能重复。 |
|
||||
| `RUNNER_LABELS` | | Runner 标签,填写此项会增加新的标签,<br>若填入多个标签则用半角逗号分隔。<br>示例: `label1,label2` |
|
||||
| `WORK_FOLDER` | | 工作文件夹,留空随机生成,几乎用不上。 |
|
||||
| `RUNNER_GROUP` | | Runner 组,默认值为`Default`,具体参见[文档](https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/manage-access)。 |
|
||||
| `AUTO_UNREGISTER` | | 是否在容器停止时从 github.com 注销 Runner,默认为 `false`。 |
|
||||
|
||||
关于标注了**REST API**的问题,参考[文档](https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28)。
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# Simple Github Action Runner In Docker
|
||||
|
||||

|
||||
|
||||
A simple self-hosted actions runner running in a container
|
||||
|
||||
## Features
|
||||
|
||||
- Supports Docker-in-Docker
|
||||
|
||||
### Environment Variables
|
||||
| Parameter | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `ROLE` | Required | Used to differentiate between enterprise, organization, and personal repositories.<br />Use `enterprises` for enterprise, `orgs` for organization, and `repos` for personal repositories.<br />**REST API** |
|
||||
| `REPO` | Required | Format for enterprise: `enterpriseName`<br />Format for organization: `orgName`<br />Format for personal repository: `owner/repo`<br />**REST API** |
|
||||
| `RUNNER_GITHUB_TOKEN` | Required | [Fine-grained PAT is recommended](https://github.com/settings/personal-access-tokens/new).<br />For enterprises:<br />**Fine-grained PAT cannot be used for enterprises**<br />OAuth app tokens and PAT (classic) require the `manage_runners:enterprise` permission.<br />For organizations:<br />Fine-grained PAT should have read and write permissions for Self-hosted runners.<br />OAuth tokens and PAT (classic) require `admin:org` permissions,<br />additionally, `repo` permissions are required for private organization repositories.<br />For personal repositories:<br />Fine-grained PAT should have read and write permissions for Administration.<br />OAuth tokens and PAT (classic) require `repo` permissions.<br />[How to create a token?](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)<br />**REST API** |
|
||||
| `RUNNER_NAME` | | Runner name. If left empty, it will be randomly generated.<br />Runner names must be unique within the same personal repository (or enterprise/organization). |
|
||||
| `RUNNER_LABELS` | | Runner labels. Filling this will add new labels..<br />Use commas to separate multiple labels.<br />Example: `label1,label2` |
|
||||
| `WORK_FOLDER` | | Working directory. If left empty, it will be randomly generated. Rarely needed. |
|
||||
| `RUNNER_GROUP` | | Runner group. The default value is `Default`. For details, refer to the [documentation](https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/manage-access). |
|
||||
| `AUTO_UNREGISTER` | | Whether to unregister the Runner from github.com when the container stops. <br />Default is `false`. It is recommended to map /home/runner/.runner_config <br />to a local when selecting false. This folder saves Runner's login status. |
|
||||
|
||||
For parameters marked with **REST API**, refer to the [documentation](https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28).
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
name: Action Runner
|
||||
tags:
|
||||
- DevOps
|
||||
title: Github 自托管运行器
|
||||
description: Github 自托管运行器
|
||||
additionalProperties:
|
||||
key: action-runner
|
||||
name: Action Runner
|
||||
tags:
|
||||
- DevOps
|
||||
shortDescZh: Github 自托管运行器
|
||||
shortDescEn: The Self-hosted Runner for GitHub Actions
|
||||
type: tool
|
||||
crossVersionUpdate: true
|
||||
limit: 0
|
||||
recommend: 0
|
||||
website: https://github.com/actions/runner
|
||||
github: https://github.com/actions/runner
|
||||
document: https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue