-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.36 KB
/
Copy pathdeploy-staging.yml
File metadata and controls
50 lines (43 loc) · 1.36 KB
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
name: Deploy (staging)
on:
workflow_run:
workflows: ['Validate'] # must match validate.yml's name
types: [completed]
branches: [main]
concurrency:
group: cf-worker-staging
cancel-in-progress: true
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment: staging
permissions:
contents: read
deployments: write
steps:
- name: ⬇️ Checkout the validated commit
uses: actions/checkout@v7
with:
ref: ${{ github.event.workflow_run.head_sha }}
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: 📥 Install deps
run: pnpm i --frozen-lockfile
- name: 🏗️ Build (inject staging vars)
env:
SITE_URL: ${{ vars.SITE_URL }}
ENV_NAME: staging
PUBLIC_UMAMI_SITE_ID: ${{ vars.PUBLIC_UMAMI_SITE_ID }}
PUBLIC_UMAMI_SHARE_URL: ${{ vars.PUBLIC_UMAMI_SHARE_URL}}
GH_API_TOKEN: ${{ vars.GH_API_TOKEN }}
run: pnpm build
- name: 🚀 Deploy with Wrangler
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy --env staging