diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 9090e2e..62bb006 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,5 +1,8 @@ # CI:每次推送自动运行完整测试套件(本地与云端同一入口:node scripts/ci.mjs) -# 网络适配:服务器在国内,job 容器镜像走腾讯内网镜像源,npm/pnpm 走国内 registry +# 网络适配(服务器在国内): +# 1) 不使用任何远程 action(actions/checkout 会被解析到 github.com 导致挂死),改用内置环境变量手动 clone +# 2) job 容器镜像走腾讯内网镜像源(runner 标签已指向 mirror.ccs.tencentyun.com) +# 3) npm/pnpm 走国内 registry name: CI on: push: @@ -12,8 +15,11 @@ jobs: container: image: mirror.ccs.tencentyun.com/library/node:22-bookworm steps: - - name: 检出代码 - uses: actions/checkout@v4 + - name: 检出代码(内网闭环,不访问 github) + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git clone --depth 1 "https://x-access-token:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/root/daywork.git" . + git checkout "$GITHUB_SHA" - name: 安装 pnpm run: npm install -g pnpm@11 --registry=https://registry.npmmirror.com @@ -34,8 +40,11 @@ jobs: image: mirror.ccs.tencentyun.com/library/node:22-bookworm continue-on-error: true steps: - - name: 检出代码 - uses: actions/checkout@v4 + - name: 检出代码(内网闭环,不访问 github) + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git clone --depth 1 "https://x-access-token:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/root/daywork.git" . + git checkout "$GITHUB_SHA" - name: 安装 pnpm run: npm install -g pnpm@11 --registry=https://registry.npmmirror.com