Files
qqbotsdk/.gitea/workflows/deploy-docs.yml
T
snowy-yang 94a37011f0 fix: CI 回归直连 pypi(探测证实 runner 在海外、github/pypi/npm 全通),部署加 secrets 在场探测
probe.yml 结果:github/uv-release/pypi/npm/npmmirror 全部 200、CF API
可达(404 为根路径正常返回),仅 tuna 403——tuna 只服务大陆 IP,说明
runner 在海外,上一轮的镜像化是误诊且 pip 走 tuna 被 403 直接打断。
ci.yml 回归最简形态:pip install uv + uv sync,零镜像零 github 依赖。

部署工作流两轮均死于下载完 wrangler 之后、网络与 wrangler 均无嫌疑,
指向 secrets 配置问题;加一步把 CLOUDFLARE_API_TOKEN/ACCOUNT_ID 的
set/MISSING 写进 commit status(不泄露值),下次运行即可确诊。
2026-09-24 20:34:07 +08:00

46 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: 部署文档(Cloudflare Pages)
on:
push:
branches: [main]
paths:
- "index.html"
- "_sidebar.md"
- "README.md"
- "docs/**"
- "examples/**"
- "CHANGELOG.md"
- "scripts/deploy_docs.sh"
- ".gitea/workflows/deploy-docs.yml"
workflow_dispatch:
jobs:
deploy-docs:
name: Cloudflare Pages
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
# 日志匿名不可读:把 secrets 在场情况写进 commit status 便于远程
# 排查(只报 set/MISSING,不泄露值)
- name: 探测 secrets 是否配置
env:
TOKEN: ${{ secrets.GITEA_TOKEN }}
CF_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CF_ACCOUNT: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
SERVER="${GITHUB_SERVER_URL:-https://gitea.4i.hk}"
s() { [ -n "$2" ] && echo set || echo MISSING; }
curl -s -m 10 -X POST \
-H "Authorization: token $TOKEN" \
-H 'Content-Type: application/json' \
-d "{\"state\":\"success\",\"context\":\"deploy/secrets\",\"description\":\"CLOUDFLARE_API_TOKEN=$(s x "$CF_TOKEN") CLOUDFLARE_ACCOUNT_ID=$(s x "$CF_ACCOUNT")\"}" \
"$SERVER/api/v1/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" -o /dev/null
- name: 组装并部署(wrangler Direct Upload)
run: bash scripts/deploy_docs.sh
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}