-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.21 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: aws s3 + cloudfront CI/CD
on:
push:
branches:
- main
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Node 설치
uses: actions/setup-node@v4
- name: Github Repository 파일 불러오기
uses: actions/checkout@v4
- name: nvm을 활용한 프로젝트의 Node 설치
uses: irby/setup-node-nvm@master
- name: yarn 설치
run: |
npm install -g yarn
yarn --version
- name: 패키지 설치
run: |
yarn install
- name: 빌드
run: |
yarn build
- name: AWS credentials 설정(aws resource접근)
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://next-blog-project
aws s3 cp ./out s3://next-blog-project/ --recursive
- name: Cloudfornt 캐시 무효화
run: aws cloudfront create-invalidation --distribution-id E12Q5DCOCOBVQC --paths "/*"