Files
CloudSSH/.github/workflows/deploy.yml
T
TanXin 59497b88a7 feat: 支持 production/test 双环境部署
- wrangler.toml: 新增 [env.test] 环境配置,移除硬编码自定义域名
- package.json: 新增 deploy:test 脚本
- .github/workflows/deploy.yml: 支持 test/main 双分支部署
- README/README_en: 更新部署流程和本地开发说明
2026-06-24 11:47:22 +08:00

39 lines
989 B
YAML

name: Deploy to Cloudflare Workers
on:
push:
branches: [test, main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: pnpm/action-setup@v4
with:
version: 'latest'
- name: Install dependencies
run: |
pnpm install
cd frontend && pnpm install
- name: Build frontend and deploy (test)
if: github.ref == 'refs/heads/test'
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: pnpm run deploy:test
- name: Build frontend and deploy (production)
if: github.ref == 'refs/heads/main'
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: pnpm run deploy