ci(gitea): 检出改为从内网 Gitea 克隆,绕开 github.com 拉 actions/checkout
deploy-132 / deploy (push) Failing after 33s
deploy-132 / deploy (push) Failing after 33s
内网 runner 连不上 github.com,actions/checkout@v4 下载 action 时 unexpected EOF。 改用 git init+fetch 从 git.sundynix.cn(同内网必达)拉当前分支,用工作流自带 github.token 认证,不再依赖 github.com。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -16,8 +16,14 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest # 须匹配 128 上已注册 runner 的标签;不符请改成你的标签
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v4
|
||||
# 不用 actions/checkout(它要去 github.com 下载 action,内网 runner 连不上会 EOF);
|
||||
# 直接从内网 Gitea 用工作流自带 token 拉本仓库当前分支。init+fetch 不怕工作目录非空。
|
||||
- name: 检出代码(内网 Gitea)
|
||||
run: |
|
||||
git init -q .
|
||||
git remote add origin "https://token:${{ github.token }}@git.sundynix.cn/${{ github.repository }}.git"
|
||||
git fetch -q --depth 1 origin "${{ github.ref_name }}"
|
||||
git checkout -q FETCH_HEAD
|
||||
|
||||
- name: 构建 4 个应用镜像(在 runner 上)
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user