From e7d94c11fd779756fb2078f36c44f492144b158f Mon Sep 17 00:00:00 2001 From: QunLIn Date: Sat, 3 Oct 2026 10:40:22 +0800 Subject: [PATCH] =?UTF-8?q?CI=20=E6=9E=84=E5=BB=BA=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=90=8E=E4=B8=8A=E6=8A=A5=E9=83=A8=E7=BD=B2=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=88=B0=20api.200181.xyz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 中转机 sync.sh 同步完成后会上报 phase=synced,CI 在 COS 上传后 上报 phase=built。打开 https://api.200181.xyz/api/deploy-status 即可查看国内线路是否同步完成(state: synced/syncing)。 需在 Gitea 仓库 Secrets 配置 RSS_API_TOKEN(未配置则跳过上报)。 --- .github/workflows/deploy.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 851cb081..b2902d23 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -288,6 +288,28 @@ jobs: echo "📤 更新 hash 文件到腾讯云 COS..." coscmd upload public/.build_hash /__build_hash + - name: Report deploy status (built) + # 上报「构建完成、产物已进 COS」到 api.200181.xyz 的部署状态接口, + # 中转机同步完成后会上报 phase=synced —— 打开 + # https://api.200181.xyz/api/deploy-status 即可看到国内线路是否同步完。 + # 需要 Gitea 仓库 Secrets 里配置 RSS_API_TOKEN = rss-robot-cf 的站点口令; + # 未配置时静默跳过上报(不影响部署)。 + if: steps.check-upload.outputs.need_upload == 'true' + continue-on-error: true + env: + REPORT_TOKEN: ${{ secrets.RSS_API_TOKEN }} + run: | + if [ -z "$REPORT_TOKEN" ]; then + echo "ℹ️ 未配置 RSS_API_TOKEN,跳过部署状态上报" + exit 0 + fi + BUILD_HASH="${{ steps.hash.outputs.build_hash }}" + curl -s --max-time 20 -X POST \ + "https://api.200181.xyz/api/deploy-status?token=${REPORT_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{\"hash\":\"${BUILD_HASH}\",\"phase\":\"built\"}" \ + && echo "✅ 已上报 built: ${BUILD_HASH:0:12}" + - name: Upload to UpYun # ┌─────────────────────────────────────────────────────────────────┐ # │ 2026-10-03 起永久跳过海外直传:本 runner 在境外,对 UpYun v0 接口 │