forked from 0xPolygon/polygon-token-list
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.02 KB
/
Copy pathdeploy.yaml
File metadata and controls
44 lines (38 loc) · 1.02 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
run-name: Deploy ${{ github.ref_name }}
on:
push:
branches:
- master
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get-env:
runs-on: ubuntu-latest
outputs:
env: ${{ steps.set-env.outputs.env }}
steps:
- id: set-env
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
export ENV=production
fi
if [ "${{ github.ref_name }}" == "dev" ]; then
export ENV=staging
fi
echo "env=$ENV" >> "$GITHUB_OUTPUT"
build-and-deploy:
needs: [get-env]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- run: npm ci
- run: npm run build
- name: Deploy bundle
uses: cloudflare/wrangler-action@v3
with:
environment: ${{ needs.get-env.outputs.env }}
apiToken: ${{ secrets.CF_WORKER_API_TOKEN }}
accountId: ${{ secrets.CF_WORKER_ACCOUNT_ID }}