31 lines
927 B
YAML
31 lines
927 B
YAML
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
|