Skip to content

Commit f7e355f

Browse files
committed
✨ feat: client 빌드 파일 경로 변경 및 배포방식 변경
1 parent 9caf359 commit f7e355f

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

.github/workflows/deploy_client.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,35 @@ on:
88
- "client/**"
99
workflow_dispatch: # 수동 실행을 허용하는 이벤트
1010

11+
env:
12+
DIST_TARGET: /var/dist
13+
1114
jobs:
12-
deployment:
13-
runs-on: ubuntu-latest
15+
deploy:
16+
runs-on: [self-hosted, prod]
1417
steps:
15-
# public 서버로 ssh 접속
16-
- name: ssh connection
17-
uses: appleboy/[email protected]
18+
- name: 코드 체크아웃
19+
uses: actions/checkout@v4
20+
21+
- name: Node.js 설정
22+
uses: actions/setup-node@v4
1823
with:
19-
host: ${{ secrets.CLOUD_PUBLIC_INSTANCE_HOST }}
20-
username: ${{ secrets.CLOUD_PUBLIC_INSTANCE_USERNAME }}
21-
key: ${{ secrets.CLOUD_PUBLIC_INSTANCE_SSH_KEY }}
22-
port: ${{ secrets.CLOUD_PUBLIC_INSTANCE_PORT }}
23-
script: |
24-
export NVM_DIR=~/.nvm
25-
source ~/.nvm/nvm.sh
24+
node-version: "22"
25+
cache: "npm"
26+
cache-dependency-path: client/package-lock.json
27+
28+
- name: 의존성 설치
29+
working-directory: ./client
30+
run: npm ci
2631

27-
cd /var/web05-Denamu
28-
git pull origin main
29-
cd client/
32+
- name: 클라이언트 빌드
33+
working-directory: ./client
34+
run: npm run build
3035

31-
npm ci
32-
npm run build
36+
- name: 빌드 결과물 배포
37+
run: |
38+
sudo mkdir -p "$DIST_TARGET"
39+
sudo rm -rf "$DIST_TARGET"/*
40+
sudo cp -r ./client/dist/* "$DIST_TARGET"/
41+
sudo chown -R www-data:www-data "$DIST_TARGET"
42+
echo "✅ FE 빌드 결과물이 $DIST_TARGET 에 배포되었습니다."

0 commit comments

Comments
 (0)