Skip to content

Workflow file for this run

name: Deploy to Cloudflare Workers
on:
push:
branches:
- main # 或者你想触发部署的分支
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
run: npm install
- name: Debug Info
run: |
echo "Node version: $(node -v)"
echo "NPM version: $(npm -v)"
echo "Wrangler version: $(npx wrangler --version)"
echo "BUCKET_NAME: $BUCKET_NAME"
env:
BUCKET_NAME: ${{ secrets.BUCKET_NAME || 'default_bucket_name' }}
- name: Publish to Cloudflare Workers
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: deploy --debug
env:
USERNAME: ${{ secrets.USERNAME || 'default_username' }}
PASSWORD: ${{ secrets.PASSWORD || 'default_password' }}
BUCKET_NAME: ${{ secrets.BUCKET_NAME || 'default_bucket_name' }}