优化部署速度
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
---
|
||||
name: gitea流水线checkout改用gitee镜像
|
||||
overview: 将 .gitea/workflows 下三个工作流的 actions/checkout@v4 替换为 Gitee 镜像 https://gitee.com/liu_zhengchi/checkout@v4。
|
||||
todos:
|
||||
- id: replace-checkout-ref
|
||||
content: 将 3 个 .gitea/workflows 文件的 actions/checkout@v4 替换为 Gitee 镜像地址
|
||||
status: completed
|
||||
- id: verify-workflows
|
||||
content: 确认三处均已替换、无残留 actions/checkout@v4 且 YAML 结构完整
|
||||
status: completed
|
||||
dependencies:
|
||||
- replace-checkout-ref
|
||||
---
|
||||
|
||||
## 产品概述
|
||||
|
||||
将 Gitea Actions 流水线中的代码拉取步骤,从官方 `actions/checkout@v4` 替换为 Gitee 镜像 `https://gitee.com/liu_zhengchi/checkout@v4`,以解决 runner 无法访问 GitHub 拉取官方 action 的问题。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- 替换仓库 `.gitea/workflows/` 下 3 个工作流的「拉取代码」步骤引用:
|
||||
- `deploy.yaml`(构建并部署)
|
||||
- `mysqlup.yaml`(数据库迁移-升级)
|
||||
- `mysqldown.yaml`(数据库迁移-回滚)
|
||||
- 仅替换 checkout 的 `uses` 引用,保持步骤名、其他步骤(docker 构建/推送、SSH 部署、迁移执行)与 `env` 变量不变。
|
||||
|
||||
## 技术栈
|
||||
|
||||
- Gitea Actions(GitHub Actions 兼容语法),工作流文件为 YAML
|
||||
- 目标引用:`uses: https://gitee.com/liu_zhengchi/checkout@v4`(Gitea 支持在 `uses` 中使用完整 URL 引用外部实例 action)
|
||||
|
||||
## 实现方式
|
||||
|
||||
将 3 个文件中唯一一处的 `uses: actions/checkout@v4` 精确替换为 `uses: https://gitee.com/liu_zhengchi/checkout@v4`。
|
||||
|
||||
- 已验证 `https://gitee.com/liu_zhengchi/checkout` 为 `actions/checkout` 的 Gitee 镜像(含 `action.yml`),且存在 `v4` 标签(另有 v4.4.0 / v4.3.1),故沿用现有 `@v4` 版本号,保持行为一致。
|
||||
- 保留步骤名 `- name: 拉取代码` 与缩进层级,避免 YAML 结构变化。
|
||||
|
||||
## 实现注意
|
||||
|
||||
- 每个文件仅一处匹配,直接替换即可,禁止改动其余步骤与 `env`。
|
||||
- 镜像为第三方账号维护,属预期选择(用户指定),不做额外引入;凭据相关配置(`secrets`)保持原样,不新增 `token`/`ssh-key`。
|
||||
- 修改后确认三处均已替换且无残留 `actions/checkout@v4`。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
zt-closet-backend/
|
||||
└── .gitea/
|
||||
└── workflows/
|
||||
├── deploy.yaml # [MODIFY] 第 20-21 行「拉取代码」步骤 uses 改为 https://gitee.com/liu_zhengchi/checkout@v4
|
||||
├── mysqlup.yaml # [MODIFY] 第 25-26 行「拉取代码」步骤 uses 改为 https://gitee.com/liu_zhengchi/checkout@v4
|
||||
└── mysqldown.yaml # [MODIFY] 第 34-35 行「拉取代码」步骤 uses 改为 https://gitee.com/liu_zhengchi/checkout@v4
|
||||
```
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 拉取代码
|
||||
uses: actions/checkout@v4
|
||||
uses: https://gitee.com/liu_zhengchi/checkout@v4
|
||||
|
||||
- name: 确认 docker 可用
|
||||
run: |
|
||||
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
echo "确认通过"
|
||||
|
||||
- name: 拉取代码
|
||||
uses: actions/checkout@v4
|
||||
uses: https://gitee.com/liu_zhengchi/checkout@v4
|
||||
|
||||
- name: 确认 docker 可用
|
||||
run: |
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 拉取代码
|
||||
uses: actions/checkout@v4
|
||||
uses: https://gitee.com/liu_zhengchi/checkout@v4
|
||||
|
||||
- name: 确认 docker 可用
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user