-
Notifications
You must be signed in to change notification settings - Fork 1
30 lines (26 loc) · 921 Bytes
/
s3.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
name: S3 Deploy # Workflow 이름
on: # Event 감지
push:
branches:
- main
jobs: # Job 설정
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code. # Repo checkout
uses: actions/checkout@v2
- name: Check Node v # Node v 확인
run: node -v
- name: Install Dependencies # 의존 파일 설치
run: yarn install --frozen-lockfile
- name: Build # React Build
run: CI='false' yarn build
- name: Deploy # Upload build file to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SECRET_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ap-northeast-2
CI: ""
run: |
aws s3 cp --recursive --region ap-northeast-2 build s3://thegoods-s3
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_ID }} --paths "/*"