From 51a45031801e1bc2a7f00a57851e1dbbd49f0dac Mon Sep 17 00:00:00 2001 From: imbytecat Date: Sat, 28 Jun 2025 15:02:00 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=85=8D=E7=BD=AECI=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=92=8C=E9=83=A8=E7=BD=B2=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加一个新的wrangler.yaml文件以使用Node容器运行Cloudflare部署。 - 添加 GitHub Actions 工作流配置以使用 Go 运行程序。 - 新增GitHub Workflow配置文件以自动执行删除孤立资源任务。 - 添加用于触发工作流调度的YAML文件。 --- cloudflare/wrangler.yaml | 20 ++++++++++++++++++++ docker/multi-runner.yaml | 16 ++++++++++++++++ golang/example.yaml | 17 +++++++++++++++++ trigger/example.yaml | 7 +++++++ 4 files changed, 60 insertions(+) create mode 100644 cloudflare/wrangler.yaml create mode 100644 docker/multi-runner.yaml create mode 100644 golang/example.yaml create mode 100644 trigger/example.yaml diff --git a/cloudflare/wrangler.yaml b/cloudflare/wrangler.yaml new file mode 100644 index 0000000..bbc172c --- /dev/null +++ b/cloudflare/wrangler.yaml @@ -0,0 +1,20 @@ +# cloudflare/wrangler-action > 3.12.0 版本需要至少 node 18 版本 +# 这里做一个补丁,使用 node 容器运行 + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest-arm64 + container: node:lts + name: Deploy + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + wranglerVersion: "latest" diff --git a/docker/multi-runner.yaml b/docker/multi-runner.yaml new file mode 100644 index 0000000..11b712c --- /dev/null +++ b/docker/multi-runner.yaml @@ -0,0 +1,16 @@ +on: + workflow_dispatch: + +jobs: + go-run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + cache: false # 使用缓存会非常慢,所以禁用 + go-version-file: 'go.mod' + + - run: | + go run . diff --git a/golang/example.yaml b/golang/example.yaml new file mode 100644 index 0000000..33e9ba6 --- /dev/null +++ b/golang/example.yaml @@ -0,0 +1,17 @@ +on: + workflow_dispatch: + +jobs: + remove-orphans: + name: Remove Orphans + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + cache: false # 使用缓存会非常慢,所以禁用 + go-version-file: 'go.mod' + + - run: | + go run . diff --git a/trigger/example.yaml b/trigger/example.yaml new file mode 100644 index 0000000..c7f92b7 --- /dev/null +++ b/trigger/example.yaml @@ -0,0 +1,7 @@ +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + push: + branches: + - main