Skip to content

部署说明(正式上线版)

正式域名:https://desk.taskkernel.xyz

推荐发布方式:一条命令串联

bash
npm run deploy:pages

执行顺序:

  1. npm run content:build
  2. npm run docs:build
  3. wrangler pages deploy docs/.vitepress/dist
  4. npm run notify:telegram -- --from-file docs/deliveries/delivery-reading-desk-v1-production.md --base-url https://desk.taskkernel.xyz

非破坏性验证(不真实部署)

bash
npm run deploy:pages -- --dry-run

--dry-run 会执行内容构建和文档构建,并打印将执行的部署与通知动作,不会调用 Cloudflare 发布。

Cloudflare 变量

真实部署前需设置:

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID
  • CLOUDFLARE_PAGES_PROJECT_NAME
  • CLOUDFLARE_PAGES_BRANCH(可选,默认 main

建议:

  • token 仅授予 Pages Deploy 所需最小权限
  • 不要把 token 写入仓库,使用本地环境变量或 CI Secret

Telegram 变量

通知默认 dry-run,真实发送需要:

  • TELEGRAM_DRY_RUN=false
  • TELEGRAM_BOT_TOKEN
  • TELEGRAM_CHAT_ID

单独测试通知:

bash
# 默认 dry-run 预览
npm run notify:telegram -- --from-file docs/deliveries/delivery-reading-desk-v1-production.md --base-url "https://desk.taskkernel.xyz"

# 真实发送
TELEGRAM_DRY_RUN=false \
TELEGRAM_BOT_TOKEN=xxx \
TELEGRAM_CHAT_ID=yyy \
npm run notify:telegram -- --from-file docs/deliveries/delivery-reading-desk-v1-production.md --base-url "https://desk.taskkernel.xyz"

Cloudflare Pages 控制台构建配置(备用)

如果使用控制台自动构建:

  • Root directory: deliverables/delivery-reading-desk-v1
  • Build command: npm run content:build && npm run docs:build
  • Build output directory: docs/.vitepress/dist