-
Notifications
You must be signed in to change notification settings - Fork 7
48 lines (43 loc) · 1.3 KB
/
prod-build-deploy-s3.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
name: Build src on release tag created and deploy to s3(cloudfront)
on:
# push:
# tags:
# - "**"
push:
branches:
- "develop"
jobs:
build:
name: Build and push static to s3 cloudfront
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node modules # node modules 캐싱
uses: actions/cache@v1
id: yarn-cache
with:
path: node_modules
key: ${{ runner.OS }}-master-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
- if: steps.yarn-cache.outputs.cache-hit == 'true'
run: echo 'yarn cache hit!'
- if: steps.yarn-cache.outputs.cache-hit != 'true'
run: echo 'yarn cache missed!'
- name: Install Dependencies
run: yarn
- name: Build
run: CI=false yarn build
env:
REACT_APP_API_HOST: ${{ vars.REACT_APP_API_HOST }}
CI: ${{ vars.CI }}
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp \
--recursive \
--region ap-northeast-2 \
build s3://zabo.staging.sparcs.org