fix(ci): Preflight 改为 Gitea 标准 container:image 写法(runs-on 只填 ubuntu-latest,避免 no runner matched)
构建 & 部署 BYW VoiceHub / 构建并推送镜像 (push) Canceled after 0s
构建 & 部署 BYW VoiceHub / 部署到生产服务器 (push) Canceled after 0s
构建 & 部署 BYW VoiceHub / Preflight 语法 & 构建检查 (push) Canceled after 3m0s

This commit is contained in:
2026-09-06 10:32:55 +08:00
parent 7b3294a380
commit 97af401d89
+11 -6
View File
@@ -39,25 +39,30 @@ jobs:
# ============================================================ # ============================================================
preflight: preflight:
name: Preflight 语法 & 构建检查 name: Preflight 语法 & 构建检查
# 国内访问 GitHub actions/node-versions release 经常超时(443 ETIMEDOUT) # ⚠️ Gitea/act_runner 的写法:runs-on 只填注册时的真实标签(我们叫 ubuntu-latest);
# 所以直接用官方 node:22 镜像跑这个 Job,绕过 setup-node 下载 step # 如果要强制用某个 Docker 镜像跑这个 Job,单独写一个 container: 段。
runs-on: [ubuntu-latest:docker://node:22-bookworm-slim] # 不能写 "ubuntu-latest:docker://xxx",这是 GitHub Actions 专有语法,Gitea 不认!
runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
# 直接用官方 node:22 镜像当 Job 容器(里面自带 node 22 + npm),
# 完全绕过 setup-node 从 GitHub release 下载 node tar.gz 的国内超时老坑
container:
image: node:22-bookworm-slim
steps: steps:
- name: 📥 Checkout 代码 - name: 📥 Checkout 代码
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
# ── 我们已经用 runs-on: docker://node:22 了,所以这里不需要 actions/setup-node ── # ── 已经在 container.image=node:22 里跑了,自带 node 22,不需要 actions/setup-node ──
# 避免国内 Runner 从 github.com 下载 Node tar.gz 出现 ETIMEDOUT - name: 🔎 环境自检(确认容器里有 node/npm,版本对得上)
- name: 🔎 环境自检(node/npm 版本)
shell: bash shell: bash
run: | run: |
set -euxo pipefail set -euxo pipefail
node -v node -v
npm -v npm -v
which node npm which node npm
cat /etc/os-release 2>/dev/null | head -4 || true
- name: 🧪 安装依赖(npm ci,严格按锁文件) - name: 🧪 安装依赖(npm ci,严格按锁文件)
run: | run: |