-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (50 loc) · 1.91 KB
/
deploy-to-prod.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
57
58
59
60
61
62
63
64
65
66
67
name: Deploy prod
on:
# manual trigger
workflow_dispatch:
jobs:
deploy-prod:
runs-on: ubuntu-latest
environment:
name: prod
url: https://rules.art
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@v2-beta
with:
node-version: '16'
- name: Install Dependencies
run: yarn --ignore-scripts
- name: Prepare build
run: yarn prepare
env:
REACT_APP_GRAPHQL_URI: ${{ vars.REACT_APP_GRAPHQL_URI }}
- name: Build
run: yarn build
env:
REACT_APP_GRAPHQL_URI: ${{ vars.REACT_APP_GRAPHQL_URI }}
REACT_APP_REST_URI: ${{ vars.REACT_APP_REST_URI }}
PUBLIC_URL: ${{ vars.PUBLIC_URL }}
REACT_APP_ALGOLIA_ID: ${{ vars.REACT_APP_ALGOLIA_ID }}
REACT_APP_ALGOLIA_KEY: ${{ vars.REACT_APP_ALGOLIA_KEY }}
REACT_APP_STRIPE_ID: ${{ vars.REACT_APP_STRIPE_ID }}
REACT_APP_STARKNET_NETWORK_NAME: ${{ vars.REACT_APP_STARKNET_NETWORK_NAME }}
REACT_APP_STARKNET_NODE_URL: ${{ vars.REACT_APP_STARKNET_NODE_URL }}
REACT_APP_ALCHEMY_KEY: ${{ vars.REACT_APP_ALCHEMY_KEY }}
AWS_S3_BUCKET: ${{ vars.AWS_S3_BUCKET }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Deploy
run: aws s3 sync ./build s3://$AWS_S3_BUCKET --delete
env:
AWS_S3_BUCKET: ${{ vars.AWS_S3_BUCKET }}
- name: Invalidate Cloudfront cache
run: aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
env:
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ vars.AWS_CLOUDFRONT_DISTRIBUTION_ID}}