-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (43 loc) · 1.67 KB
/
deploy-staging.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: deploy-staging
on:
push:
branches:
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: node 16
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: npm config
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" "$FONTAWESOME_NPM_AUTH_TOKEN"
- name: npm ci
run: npm ci
- name: npm run build:prod
run: npm run build:prod
- name: aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GH_ACTIONS_RELEASE_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GH_ACTIONS_RELEASE_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.GH_ACTIONS_RELEASE_AWS_REGION }}
- name: deploy to s3
run: |
aws s3 rm --recursive s3://app.staging.getmethodic.com/chronicle/
aws s3 cp --recursive build/ s3://app.staging.getmethodic.com/chronicle/
- name: clear cloudflare cache
run: |
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${{ secrets.METHODIC_CLOUDFLARE_ZONE_ID }}/purge_cache" \
-H "X-Auth-Email: ${{ secrets.METHODIC_CLOUDFLARE_EMAIL }}" \
-H "X-Auth-Key: ${{ secrets.METHODIC_CLOUDFLARE_API_KEY }}" \
-H "Content-Type: application/json" \
--data '{"files":["https://app.staging.getmethodic.com/chronicle"]}'