-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.01 KB
/
deploy.yml
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
name: Deploy
on:
workflow_dispatch:
push:
branches:
- main
- staging
jobs:
deploy:
timeout-minutes: 2
runs-on: ubuntu-22.04
name: Deploy
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.node-version'
cache: 'npm'
- name: Install npm dependencies
run: npm ci
- name: Set wrangler version
id: wrangler
run: echo "version=$(jq -r .devDependencies.wrangler packages/cf/package.json)" >> "$GITHUB_OUTPUT"
- name: Deploy
uses: cloudflare/wrangler-action@f84a562284fc78278ff9052435d9526f9c718361 # v3.7.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
wranglerVersion: ${{ steps.wrangler.outputs.version }}
workingDirectory: 'packages/cf'
command: deploy --env ${{ github.ref == 'refs/heads/main' && 'prod' || 'staging' }}