-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.19 KB
/
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
name: React build
on:
push:
branches:
- develop # 개발서버 배포
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code # 레포지토리 체크아웃
uses: actions/checkout@v3
- name: Cache node modules # node_modules 캐싱
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install Dependencies # 의존성 설치
run: yarn install
- name: Create .env.production file
run: |
echo "${{ secrets.ENV_PRODUCTION }}" > .env
- name: Build # React 빌드
run: yarn build
- name: Deploy to S3 # S3에 배포
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME_DEV }}
run: |
aws s3 cp \
--recursive \
--region $AWS_REGION \
dist s3://$S3_BUCKET_NAME