chore: 配置CI工作流程和部署文件
- 添加一个新的wrangler.yaml文件以使用Node容器运行Cloudflare部署。 - 添加 GitHub Actions 工作流配置以使用 Go 运行程序。 - 新增GitHub Workflow配置文件以自动执行删除孤立资源任务。 - 添加用于触发工作流调度的YAML文件。
This commit is contained in:
20
cloudflare/wrangler.yaml
Normal file
20
cloudflare/wrangler.yaml
Normal file
@@ -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"
|
||||||
16
docker/multi-runner.yaml
Normal file
16
docker/multi-runner.yaml
Normal file
@@ -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 .
|
||||||
17
golang/example.yaml
Normal file
17
golang/example.yaml
Normal file
@@ -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 .
|
||||||
7
trigger/example.yaml
Normal file
7
trigger/example.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
Reference in New Issue
Block a user