ci: add GitHub Actions deployment

This commit is contained in:
gdz66601 committed 2026-09-19 07:54:02 +08:00
1 parent 19e9b4cb14
commit bb44c55c90
3 files changed
+73 -4

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: production-deploy
cancel-in-progress: false
permissions:
contents: read
jobs:
deploy:
name: Deploy to Cloudflare
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12.0
cache: npm
- name: Install dependencies
run: npm ci
- name: Check project
run: npm run check
- name: Apply D1 migrations
run: npx wrangler d1 migrations apply DB --remote
- name: Deploy Worker
run: npm run deploy