commit 51a45031801e1bc2a7f00a57851e1dbbd49f0dac Author: imbytecat Date: Sat Jun 28 15:02:00 2025 +0800 chore: 配置CI工作流程和部署文件 - 添加一个新的wrangler.yaml文件以使用Node容器运行Cloudflare部署。 - 添加 GitHub Actions 工作流配置以使用 Go 运行程序。 - 新增GitHub Workflow配置文件以自动执行删除孤立资源任务。 - 添加用于触发工作流调度的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