Introduced a new GitHub Actions workflow for automatic deployment to Cloudflare Workers. Added CLAUDE.md for Claude Code guidance. Updated deployment instructions in both English and Chinese README files to reflect the new GitHub Actions-based deployment process.
48 lines
954 B
YAML
48 lines
954 B
YAML
name: Deploy Worker
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'LICENSE'
|
|
- '.gitignore'
|
|
- '.editorconfig'
|
|
- '.vscode/**'
|
|
- 'docs/**'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
name: Deploy to Cloudflare Workers
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run linter
|
|
run: npm run lint
|
|
|
|
- name: Run type check
|
|
run: npm run type-check
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Build & Deploy Worker
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|