Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ“¦ chore: Netlify 쒅속성 제거λ₯Ό μœ„ν•œ NGINX μ„€μ • λ³€κ²½ 및 FE CD 슀크립트 μž‘μ„± #294

Merged
merged 3 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/deploy_client.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deployment
name: Server Deployment

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
4 changes: 2 additions & 2 deletions client/src/components/about/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const HeroSection = () => {
<div className="text-center max-w-4xl">
<div className="flex items-center justify-center space-x-2 mb-6">
<img
src="https://api.denamu.site/files/Denamu_Logo_ENG.svg"
src="https://denamu.site/files/Denamu_Logo_ENG.svg"
alt="Denamu English Logo"
className="w-32 md:w-52"
/>
Expand All @@ -36,7 +36,7 @@ export const HeroSection = () => {

<div className="flex-grow flex items-start justify-center p-4 md:p-8">
<img
src="https://api.denamu.site/files/about-first.png"
src="https://denamu.site/files/about-first.png"
alt="Service Preview"
className="max-w-[90%] md:max-w-[80%] h-auto object-contain"
/>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/common/Card/PostCardContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<CardContent className="p-0">
<div className="relative -mt-6 ml-4 mb-3">
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/queries/useTrendingPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion client/src/store/useChatStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
39 changes: 39 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
2 changes: 1 addition & 1 deletion server/src/common/email/mail_content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function createMailContent(
<div style="font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 κ³ λ”•', sans-serif; margin: 0; padding: 1px; background-color: #f4f4f4;">
<div style="max-width: 600px; margin: 20px auto; background-color: #ffffff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div style="text-align: center; padding: 20px 0; border-bottom: 2px solid #f0f0f0;">
<img src="https://api.denamu.site/files/Denamu_Logo_KOR.png" alt="Denamu Logo" width="244" height="120">
<img src="https://denamu.site/files/Denamu_Logo_KOR.png" alt="Denamu Logo" width="244" height="120">
</div>
<div style="padding: 20px 0;">
${
Expand Down
Loading