-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.31 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
name: Deploy To S3
on:
push:
branches:
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Github Repository 파일 불러오기
uses: actions/checkout@v4
- name: Node.js 설정
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Vite 설치
run: npm install -g vite
- name: 의존성 설치
run: npm ci
- name: 프로젝트 빌드
env:
VITE_MAP_API_KEY: ${{ secrets.VITE_MAP_API_KEY }}
VITE_API_ENDPOINT: ${{ secrets.VITE_API_ENDPOINT }}
VITE_SOCKET_ENDPOINT: ${{ secrets.VITE_SOCKET_ENDPOINT }}
run: vite build
- name: AWS Resource에 접근할 수 있게 AWS credentials 설정
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-northeast-2
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: S3 기존 파일들 전체 삭제 후 새로 업로드
run: |
aws s3 rm --recursive s3://catchmi-web-page
aws s3 cp ./dist s3://catchmi-web-page/ --recursive
- name: Cloudfront 캐시 무효화
run: aws cloudfront create-invalidation --distribution-id E27N31R2646KQX --paths "/*"