-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 2.01 KB
/
product.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
66
67
name: Deploy to production
on:
push:
branches:
- main
workflow_dispatch: # 수동 실행
jobs:
deploy:
name: Build, Deploy to S3 bucket
runs-on: [ubuntu-latest]
strategy:
matrix:
node-version: [12.16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Create .env
shell: bash
env:
PROD_APP_ID: ${{ secrets.PROD_APP_ID }}
PROD_API_URL: ${{ secrets.PROD_API_URL }}
PROD_PRESET_BIZ: ${{ secrets.PROD_PRESET_BIZ }}
PROD_PRESET: ${{ secrets.PROD_PRESET }}
GA_KEY: ${{ secrets.TRACKING_ID }}
run: |
touch .env
echo REACT_APP_APP_ID="$PROD_APP_ID" >> .env
echo REACT_APP_API_URL="$PROD_API_URL" >> .env
echo REACT_APP_PRESET_BIZ="$PROD_PRESET_BIZ" >> .env
echo REACT_APP_PRESET="$PROD_PRESET" >> .env
echo REACT_APP_TRACKING_ID="$GA_KEY" >> .env
cat .env
- name: NPM install
run: npm install
- name: Build
run: npm run build
- name: Transfer to S3 for serving static
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: mudda-client-prod
AWS_ACCESS_KEY_ID: ${{ secrets.REACT_APP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.REACT_APP_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-northeast-2
SOURCE_DIR: 'build'
- name: invalidate
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.DISTRIBUTION_ID }}
PATHS: '/*'
AWS_REGION: ap-northeast-2
AWS_ACCESS_KEY_ID: ${{ secrets.REACT_APP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.REACT_APP_AWS_SECRET_ACCESS_KEY }}
continue-on-error: true