feat: Gitea Actions——ruff/pyright 检测与 Cloudflare Pages 文档自动部署

- .gitea/workflows/ci.yml:push(main)/PR/手动触发,setup-uv 装依赖
  后运行与本地一致的 uv run ruff check src tests examples + uv run
  pyright;故意未加 ruff format --check(存量 5 文件格式漂移会打红)
- .gitea/workflows/deploy-docs.yml:main 的文档文件变更时自动部署,
  经 CLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID secrets 鉴权
- scripts/deploy_docs.sh:组装纯文档 dist/(不含源码,排除
  __pycache__)后 wrangler Direct Upload 上传——CF Pages 的 Git 直连
  只支持 GitHub/GitLab,Gitea 仓库只能走 Direct Upload;新版
  wrangler 的 pages deploy 不再自动建项目,脚本先幂等 create

站点 https://qqbotsdk-docs.pages.dev 已上线。.wrangler/ 缓存与
dist/ 产物入 .gitignore。
This commit is contained in:
snowy-yang committed 2026-09-24 20:18:39 +08:00
1 parent 7e7dcbaa94
commit 35e501aabb
4 files changed
+89

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
name: 代码检测
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
lint:
name: ruff + pyright
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 安装 uv 与 Python 3.13
uses: astral-sh/setup-uv@v5
with:
python-version: "3.13"
enable-cache: true
- name: 同步依赖(含 dev 组)
run: uv sync
- name: ruff 静态检查
run: uv run ruff check src tests examples
- name: pyright 类型检查
run: uv run pyright
+29
View File
@@ -0,0 +1,29 @@
name: 部署文档
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
- 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 }}