ci: 프론트 자동 배포 구현 (Nginx 정적호스팅, main push)
CI / build (push) Failing after 10m30s

- deploy.yaml: dist 빌드 → SSH(tar)로 웹 루트 교체 → nginx reload
- deploy/nginx-sb-front.conf: SPA 폴백 + /api 프록시 샘플
- deploy/README.md: 시크릿·서버 준비 안내

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-05-31 15:55:23 +09:00
parent 5eca019967
commit 09cfb8e562
3 changed files with 105 additions and 19 deletions
+28
View File
@@ -0,0 +1,28 @@
# /etc/nginx/sites-available/sb-front (심볼릭 링크로 sites-enabled 에 연결)
server {
listen 80;
server_name _; # 도메인으로 교체
root /var/www/sb-front; # DEPLOY_PATH 와 동일
index index.html;
# SPA: 새로고침/직접 진입 시 index.html 로 폴백 (vue-router history 모드)
location / {
try_files $uri $uri/ /index.html;
}
# 해시 자산 장기 캐시
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# API 프록시 → 백엔드(8080)
location /api/ {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}