-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (56 loc) · 2.35 KB
/
develop-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
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
name: Develop-branch (Alpha) deploy actions
on:
push:
branches:
- develop
jobs:
release:
runs-on: ubuntu-latest
env:
REACT_APP_BASE_URL: ${{secrets.REACT_APP_BASE_URL}}
REACT_APP_APP_ID: ${{secrets.REACT_APP_APP_ID}}
REACT_APP_MINI_PRESET: ${{secrets.REACT_APP_MINI_PRESET}}
REACT_APP_MINI_INSTALLATION_URL: ${{secrets.REACT_APP_MINI_INSTALLATION_URL}}
REACT_APP_FIREBASE_API_KEY: ${{secrets.REACT_APP_FIREBASE_API_KEY}}
REACT_APP_FIREBASE_AUTH_DOMAIN: ${{secrets.REACT_APP_FIREBASE_AUTH_DOMAIN}}
REACT_APP_FIREBASE_PROJECT_ID: ${{secrets.REACT_APP_FIREBASE_PROJECT_ID}}
REACT_APP_FIREBASE_STORAGE_BUCKET: ${{secrets.REACT_APP_FIREBASE_STORAGE_BUCKET}}
REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{secrets.REACT_APP_FIREBASE_MESSAGING_SENDER_ID}}
REACT_APP_FIREBASE_APP_ID: ${{secrets.REACT_APP_FIREBASE_APP_ID}}
REACT_APP_FIREBASE_MEASUREMENT_ID: ${{secrets.REACT_APP_FIREBASE_MEASUREMENT_ID}}
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build
run: CI=false npm run build
- 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: 'ap-northeast-2'
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_REGION: ap-northeast-2
AWS_S3_BUCKET: ${{secrets.AWS_S3_BUCKET}}
SOURCE_DIR: 'build'
- name: Invalidate CloudFront Cache
uses: chetan/invalidate-cloudfront-action@v2
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_REGION: ap-northeast-2
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
PATHS: '/*'