-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (55 loc) · 1.89 KB
/
deploy-sync-server.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Deploy Worker
on:
push:
paths:
- .github/workflows/deploy-sync-server.yaml
- sync-server/**
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- main # triggers on pushes that contain changes
- develop
# env:
# API_TOKEN: ${{ secrets.API_TOKEN }}
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
# - name: Show github ref
# run: |
# echo ${{ github.ref }}
# echo ${{ github.ref_name }}
# echo ${{ github.head_ref }}
# - name: Build & Deploy Worker (Dev)
# if: github.head_ref == 'tay/automerge-party-flagged'
# uses: cloudflare/wrangler-action@v3
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# environment: staging
# workingDirectory: sync-server
# wranglerVersion: 3.95.0
- name: Build & Deploy Worker (Staging)
if: github.ref == 'refs/heads/develop'
uses: cloudflare/wrangler-action@v3
env:
API_TOKEN: ${{ secrets.API_TOKEN_DEV }}
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
environment: staging
workingDirectory: sync-server
wranglerVersion: 3.95.0
# secrets: API_TOKEN
- name: Build & Deploy Worker (Production)
if: github.ref == 'refs/heads/main'
env:
API_TOKEN: ${{ secrets.API_TOKEN_PROD }}
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
environment: production
workingDirectory: sync-server
wranglerVersion: 3.95.0
secrets: API_TOKEN