feat: auto-deploy Workers on main branch push

- Add push trigger on main branch (works with sync.yml)
- Skip deployment on original repo and forks without secrets
This commit is contained in:
MarSeventh
2026-04-24 20:09:18 +08:00
parent 336963b7f2
commit 35125655ca
+6
View File
@@ -1,6 +1,9 @@
name: Deploy to Cloudflare Workers
on:
push:
branches:
- main
workflow_dispatch:
inputs:
worker_name:
@@ -28,6 +31,9 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
# 仅在 fork 仓库且配置了 Cloudflare secrets 时运行
# 原仓库 push 和未配置 secrets 的 fork 不会触发部署
if: ${{ github.repository != 'MarSeventh/CloudFlare-ImgBed' && secrets.CLOUDFLARE_API_TOKEN != '' }}
steps:
- name: Checkout
uses: actions/checkout@v4