From c4a3bc0fd2e53855191009d59fc650942ae7164e Mon Sep 17 00:00:00 2001 From: asn6878 Date: Sun, 15 Dec 2024 02:20:45 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=A6=20chore:=20nginx.conf=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..d109bc5a --- /dev/null +++ b/nginx.conf @@ -0,0 +1,39 @@ +server { + listen 80 default_server; + server_name _; + + # 정적 파일 서빙 - FE 빌드 파일 + location / { + root /var/web05-Denamu/client/dist; + index index.html; # 기본 파일 설정 + try_files $uri /index.html; # SPA 지원 + } + + # 정적 파일 서빙 + location /files { + alias /var/web05-Denamu/static/; + try_files $uri $uri/ =404; # 파일이 없으면 404 반환 + } + + # API 요청을 NestJS로 프록시 + location /api { + proxy_pass http://127.0.0.1:8080; # NestJS 서버 + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + + # WebSocket 요청 프록시 + location /chat { + proxy_pass http://127.0.0.1:8080; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + proxy_read_timeout 3600s; + proxy_send_timeout 3600s; + } +} \ No newline at end of file From 00fc7e1a6eb0cf525ce1010736c9a3526f85dbf8 Mon Sep 17 00:00:00 2001 From: asn6878 Date: Thu, 19 Dec 2024 23:49:08 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=A6=20chore:=20netlify=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=EB=A5=BC=20=EC=9C=84=ED=95=9C=20Client=EC=B8=A1=20bas?= =?UTF-8?q?eURL=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/api/instance.ts | 2 +- client/src/components/about/HeroSection.tsx | 4 ++-- client/src/components/common/Card/PostCardContent.tsx | 2 +- client/src/hooks/queries/useTrendingPosts.ts | 2 +- client/src/store/useChatStore.ts | 2 +- server/src/common/email/mail_content.ts | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/api/instance.ts b/client/src/api/instance.ts index 77b3ed81..9c7dc19e 100644 --- a/client/src/api/instance.ts +++ b/client/src/api/instance.ts @@ -6,7 +6,7 @@ export const api = axios.create({ }); export const axiosInstance = axios.create({ - baseURL: "https://api.denamu.site", + baseURL: "https://denamu.site", timeout: 10000, withCredentials: true, }); diff --git a/client/src/components/about/HeroSection.tsx b/client/src/components/about/HeroSection.tsx index 2973f622..de2f6a1c 100644 --- a/client/src/components/about/HeroSection.tsx +++ b/client/src/components/about/HeroSection.tsx @@ -17,7 +17,7 @@ export const HeroSection = () => {
Denamu English Logo @@ -36,7 +36,7 @@ export const HeroSection = () => {
Service Preview diff --git a/client/src/components/common/Card/PostCardContent.tsx b/client/src/components/common/Card/PostCardContent.tsx index a8f429b9..4fa133a3 100644 --- a/client/src/components/common/Card/PostCardContent.tsx +++ b/client/src/components/common/Card/PostCardContent.tsx @@ -11,7 +11,7 @@ interface PostCardContentProps { export const PostCardContent = ({ post }: PostCardContentProps) => { const authorInitial = post.author?.charAt(0)?.toUpperCase() || "?"; - const data = `https://api.denamu.site/files/${post.blogPlatform}-icon.svg`; + const data = `https://denamu.site/files/${post.blogPlatform}-icon.svg`; return (
diff --git a/client/src/hooks/queries/useTrendingPosts.ts b/client/src/hooks/queries/useTrendingPosts.ts index d1a6c0e7..2ca583e8 100644 --- a/client/src/hooks/queries/useTrendingPosts.ts +++ b/client/src/hooks/queries/useTrendingPosts.ts @@ -13,7 +13,7 @@ export const useTrendingPosts = () => { }); useEffect(() => { - const eventSource = new EventSource("https://api.denamu.site/api/feed/trend/sse"); + const eventSource = new EventSource("https://denamu.site/api/feed/trend/sse"); eventSource.onmessage = (event) => { try { diff --git a/client/src/store/useChatStore.ts b/client/src/store/useChatStore.ts index efe8b4d6..ba1319b0 100644 --- a/client/src/store/useChatStore.ts +++ b/client/src/store/useChatStore.ts @@ -3,7 +3,7 @@ import { create } from "zustand"; import { ChatType } from "@/types/chat"; -const CHAT_SERVER_URL = "https://api.denamu.site"; +const CHAT_SERVER_URL = "https://denamu.site"; interface ChatStore { chatHistory: ChatType[]; diff --git a/server/src/common/email/mail_content.ts b/server/src/common/email/mail_content.ts index 67dcf9d7..41be0335 100644 --- a/server/src/common/email/mail_content.ts +++ b/server/src/common/email/mail_content.ts @@ -10,7 +10,7 @@ export function createMailContent(
- Denamu Logo + Denamu Logo
${ From aab689f6acb4f86236fa670baebb4a8bebf945d8 Mon Sep 17 00:00:00 2001 From: asn6878 Date: Fri, 20 Dec 2024 23:47:11 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=A6=20chore:=20=ED=81=B4=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EC=96=B8=ED=8A=B8=20CD=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy_client.yml | 32 +++++++++++++++++++ .../{deploy.yml => deploy_server.yml} | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy_client.yml rename .github/workflows/{deploy.yml => deploy_server.yml} (99%) diff --git a/.github/workflows/deploy_client.yml b/.github/workflows/deploy_client.yml new file mode 100644 index 00000000..e5eef871 --- /dev/null +++ b/.github/workflows/deploy_client.yml @@ -0,0 +1,32 @@ +name: Client Deployment + +on: + push: + branches: + - main + paths: + - "client/**" + workflow_dispatch: # 수동 실행을 허용하는 이벤트 + +jobs: + deployment: + runs-on: ubuntu-latest + steps: + # public 서버로 ssh 접속 + - name: ssh connection + uses: appleboy/ssh-action@v1.1.0 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH_KEY }} + port: ${{ secrets.PORT }} + script: | + export NVM_DIR=~/.nvm + source ~/.nvm/nvm.sh + + cd /var/web05-Denamu + git pull origin main + cd client/ + + npm ci + npm run build \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy_server.yml similarity index 99% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy_server.yml index 266e479e..b5296191 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy_server.yml @@ -1,4 +1,4 @@ -name: Deployment +name: Server Deployment on: push: