-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.3 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
49
50
51
52
53
54
55
name: Admin Deploy
on:
pull_request:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
checks: write
pull-requests: write
steps:
- name: Repository 체크아웃
uses: actions/checkout@v3
- name: Node 설정
uses: actions/setup-node@v3
with:
node-version: '18.16.1'
- name: node_modules 캐싱
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: 의존성 설치
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --pure-lockfile
- name: 클라이언트 빌드
run: yarn build
- name: AWS CLI 설정
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: S3 이전 파일 삭제
run: |
aws s3 rm ${{ secrets.AWS_S3_URL }} --recursive
- name: S3에 배포
run: |
aws s3 sync ./dist ${{ secrets.AWS_S3_URL }}