-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (43 loc) · 1.05 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
44
45
46
47
48
name: react deploy
on:
push:
branches:
- main
paths:
- client/src/**
workflow_dispatch:
jobs:
build:
env:
CI: false
name: react-project build
runs-on: ubuntu-20.04
defaults:
run:
working-directory: "./client"
steps:
- name: checkout code
uses: actions/[email protected]
with:
node-version: 16
- name: cache dependency
uses: actions/[email protected]
with:
path: node_modules
key: ${{runner.os}}-build-${{hashFiles('**/package-lock.json')}}
restore-key: |
${{runner.os}}-build-
${{runner.os}}-
- name: install dependency
run: npm i
- name: build project
run: npm run build
- name: s3 upload
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://dmreactdeploy