-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 1.86 KB
/
frontend.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
56
57
58
59
60
61
62
63
64
65
66
name: CI(Frontend)
on:
workflow_dispatch:
push:
branches: ["main"]
paths:
- "frontend/**"
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- name: VM으로 파일을 전송합니다.
uses: actions/checkout@v3
- name: Node.js 환경을 셋팅합니다.
uses: actions/setup-node@v3
with:
node-version: 20
- name: 환경변수를 설정합니다.
run: |
echo "VITE_API_URL=$VITE_API_URL" >> .env
echo "VITE_IMG_URL=$VITE_IMG_URL" >> .env
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}
VITE_IMG_URL: ${{ secrets.VITE_IMG_URL }}
- name: 의존성 패키지들을 설치합니다.
run: npm ci
- name: 빌드를 실행합니다.
run: npm run build --if-present
- name: 빌드 결과물을 artifact로 업로드합니다.
uses: actions/upload-artifact@v3
with:
name: build-frontend
path: frontend/dist
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: 빌드 결과물을 다운로드합니다.
uses: actions/download-artifact@v3
with:
name: build-frontend
- name: S3 버킷에 업로드합니다.
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 sync \
. s3://www.a2cartag.com \
--region ap-northeast-2 \
--delete