ci: add CD — auto deploy to Cloudflare Workers on push to main

Test → Build UI → wrangler deploy. Secrets configured.

小橘 🍊(NEKO Team)
This commit is contained in:
小橘 2026-04-13 09:18:04 +00:00
parent 5cc46b3e9b
commit 066f120134

View File

@ -16,3 +16,21 @@ jobs:
node-version: 22
- run: npm install
- run: npm test
deploy:
needs: test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm install
- name: Build UI
run: cd packages/engine/ui && npm run build && cp dist/index.html ../src/ui.html
- name: Deploy to Cloudflare Workers
run: cd packages/engine && npx wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}