add:增加action脚本

This commit is contained in:
lsy committed 2026-02-16 10:46:37 +08:00
1 parent 3bcc9ebb99
commit fa536d876e
5 files changed
+117 -19

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
name: Deploy Worker
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: "1.3.9"
- name: Install dependencies
run: bun install
- name: Build admin
run: bun run --filter new-api-lite-admin build
- name: Apply D1 migrations (remote)
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: bunx wrangler d1 migrations apply DB --remote --config apps/worker/wrangler.toml
- name: Deploy worker
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: bunx wrangler deploy --config apps/worker/wrangler.toml