Skip to content

Commit 50825af

Browse files
authored
Cloudflare CI/CD (#330)
1 parent f15b022 commit 50825af

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy CF latest-snapshot
2+
on:
3+
pull_request:
4+
paths:
5+
- 'cf/latest-snapshot'
6+
- '.github/workflows/deploy-cf-latest-snapshot.yml'
7+
push:
8+
paths:
9+
- 'cf/latest-snapshot'
10+
- '.github/workflows/deploy-cf-latest-snapshot.yml'
11+
12+
jobs:
13+
check-and-deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Deployment check
18+
uses: cloudflare/wrangler-action@v3
19+
with:
20+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
21+
workingDirectory: "cf/latest-snapshot"
22+
command: deploy --dry-run
23+
- name: Deploy
24+
if: github.ref == 'refs/heads/main' && ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' )
25+
uses: cloudflare/wrangler-action@v3
26+
with:
27+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
28+
workingDirectory: "cf/latest-snapshot"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy CF prune-latest
2+
on:
3+
pull_request:
4+
paths:
5+
- 'cf/prune-latest'
6+
- '.github/workflows/deploy-cf-prune-latest.yml'
7+
push:
8+
paths:
9+
- 'cf/prune-latest'
10+
- '.github/workflows/deploy-cf-prune-latest.yml'
11+
12+
jobs:
13+
check-and-deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Deployment check
18+
uses: cloudflare/wrangler-action@v3
19+
with:
20+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
21+
workingDirectory: "cf/prune-latest"
22+
command: deploy --dry-run
23+
- name: Deploy
24+
if: github.ref == 'refs/heads/main' && ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' )
25+
uses: cloudflare/wrangler-action@v3
26+
with:
27+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
28+
workingDirectory: "cf/prune-latest"

0 commit comments

Comments
 (0)