Skip to content

Commit

Permalink
Merge pull request #344 from boostcampwm-2022/dev
Browse files Browse the repository at this point in the history
실서버에 0.2.0 버전을 배포합니다.
  • Loading branch information
NaamuKim authored Dec 6, 2022
2 parents 38dae9a + 3c059f0 commit 9b2f22d
Show file tree
Hide file tree
Showing 222 changed files with 20,410 additions and 1,465 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/dev-scheduler-server-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Dev Scheduler Server Auto Deploy"
on:
push: # dev 브랜치 & scheduler-server 경로에 push가 일어났을 때 발생한다
branches:
- dev
paths:
- "scheduler-server/**"
workflow_dispatch: # POST 요청 및 버튼 클릭 등 임의 (수동) 실행

jobs:
deployment:
name: deployment
runs-on: ubuntu-18.04
defaults:
run:
working-directory: scheduler-server
steps: # job 구동 과정
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Build and Push Docker Image # 도커 허브에 이미지 push
uses: docker/build-push-action@v3
with:
context: ./scheduler-server
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/weview-scheduler-dev:latest

- name: Deploy with SSH
uses: appleboy/ssh-action@master
with: # 도커파일의 위치는 weview/server 위치 변경할지 고민해보기.
host: ${{ secrets.DEV_NCLOUD_HOST }}
username: ${{ secrets.DEV_NCLOUD_USERNAME }}
password: ${{ secrets.DEV_NCLOUD_PASSWORD }}
port: ${{ secrets.DEV_NCLOUD_PORT }}
script: |
cd /home/weview/server && docker compose pull
cd /home/weview/server && docker compose up --detach
47 changes: 47 additions & 0 deletions .github/workflows/main-scheduler-server-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Main Scheduler Server Auto Deploy"
on:
push:
tags:
- "v*"
paths:
- "scheduler-server/**"
workflow_dispatch:
jobs:
deployment:
name: deployment
runs-on: ubuntu-18.04
defaults:
run:
working-directory: scheduler-server
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Build and Push Docker image
uses: docker/build-push-action@v3
with:
context: ./scheduler-server
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/weview-scheduler-main:latest
${{ secrets.DOCKERHUB_USERNAME }}/weview-scheduler-main:${{github.ref_name}}
- name: Deploy with SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.MAIN_NCLOUD_HOST }}
username: ${{ secrets.MAIN_NCLOUD_USERNAME }}
password: ${{ secrets.MAIN_NCLOUD_PASSWORD }}
port: ${{ secrets.MAIN_NCLOUD_PORT }}
script: |
cd /home/weview/server && docker compose pull
cd /home/weview/server && docker compose up --detach
33 changes: 33 additions & 0 deletions .github/workflows/scheduler-server-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Scheduler Server Test Build (Pull Request)"

on:
pull_request:
branches: ["main", "dev"]
paths:
- "scheduler-server/**"
workflow_dispatch:

jobs:
integration: # 식별자
name: integration #이름
runs-on: ubuntu-18.04 # Job 구동되는 환경 명시
defaults:
run:
working-directory: scheduler-server
steps: # job 구동 과정
- name: Checkout
uses: actions/checkout@v3

- name: Use Node JS
uses: actions/setup-node@v2
with:
node-version: "16.x"

- name: Install npm
run: npm ci

- name: Test
run: npm test

- name: Build Files
run: npm run build
3 changes: 3 additions & 0 deletions client/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"plugin": ["stylelint-prettier"],
"rules": {
"selector-class-pattern": null
},
"extends": [
"stylelint-config-sass-guidelines",
"stylelint-config-prettier",
Expand Down
2 changes: 1 addition & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WeView | 함께하는 코드리뷰 커뮤니티</title>
</head>
Expand Down
8 changes: 4 additions & 4 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions client/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion client/public/vite.svg

This file was deleted.

15 changes: 13 additions & 2 deletions client/src/App.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
// fonts
@import url("https://webfontworld.github.io/gmarket/GmarketSans.css");
/*
* D2 coding (Korean) http://dev.naver.com/projects/d2coding/
*/
@font-face {
font-family: "D2Coding";
font-style: normal;
font-weight: normal;
src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/D2Coding.woff")
format("woff");
}

// pages
@import "@/styles/_global-style";
@import "@/styles/_theme";
@import "@/styles/global-style";
@import "@/styles/theme";

html,
body {
Expand Down
4 changes: 2 additions & 2 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { queryClient } from "@/react-query/queryClient";
import { isEmpty } from "@/utils/typeCheck";
import ReactRouter from "@/ReactRouter";
import CommonModalWrapper from "@/components/main/Modal/ModalWrapper/CommonModalWrapper";
import OtherModalWrapper from "@/components/main/Modal/ModalWrapper/OtherModalWrapper";
import { useRefreshInterceptor } from "@/hooks/useRefreshInterceptor";

import "./App.scss";

function App(): JSX.Element {
useRefreshInterceptor();
const queryClientRef = useRef<QueryClient>();
if (isEmpty(queryClientRef.current)) {
// current 값이 null 값일 때 변경이 발생하더라도 재렌더링이 일어나지 않기 위해 useRef 사용
Expand All @@ -20,7 +21,6 @@ function App(): JSX.Element {
<QueryClientProvider client={queryClient}>
<ReactRouter />
<CommonModalWrapper />
<OtherModalWrapper />
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
);
Expand Down
5 changes: 5 additions & 0 deletions client/src/ReactRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from "react";

import LoginCallback from "@/pages/LoginCallback/LoginCallback";
import Main from "@/pages/Main/Main";
import Post from "@/pages/Post/Post";

const ReactRouter = (): React.ReactElement => {
const router = createBrowserRouter([
Expand All @@ -14,6 +15,10 @@ const ReactRouter = (): React.ReactElement => {
path: "/redirect/github",
element: <LoginCallback />,
},
{
path: "/post/:postId",
element: <Post />,
},
]);

return <RouterProvider router={router} />;
Expand Down
9 changes: 1 addition & 8 deletions client/src/apis/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import axios from "axios";

import { AccessTokenInfo, MyInfo, PreSignedData } from "@/types/auth";
import { MyInfo, PreSignedData } from "@/types/auth";
import { API_SERVER_URL } from "@/constants/env";

import axiosInstance from "./axios";
Expand All @@ -10,11 +8,6 @@ export const githubLogInAPI = async (code: string): Promise<MyInfo> => {
return data;
};

export const tokenRefreshAPI = async (): Promise<AccessTokenInfo> => {
const { data } = await axios.get(`${API_SERVER_URL}/auth/refresh`);
return data;
};

export const logOutAPI = async (): Promise<void> => {
await axiosInstance.delete("/auth/logout");
};
Expand Down
7 changes: 0 additions & 7 deletions client/src/apis/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import axios, { AxiosRequestConfig } from "axios";

import { API_SERVER_URL } from "@/constants/env";

import {
refreshErrorHandler,
refreshInterceptor,
} from "./interceptors/refresh";

const axiosConfig: AxiosRequestConfig = {
baseURL: API_SERVER_URL,
timeout: 10000,
Expand All @@ -15,6 +10,4 @@ const axiosConfig: AxiosRequestConfig = {

const axiosInstance = axios.create(axiosConfig);

axiosInstance.interceptors.request.use(refreshInterceptor, refreshErrorHandler);

export default axiosInstance;
11 changes: 11 additions & 0 deletions client/src/apis/bookmark.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import axiosInstance from "@/apis/axios";

export const addBookmarkPost = async (postId: string): Promise<void> => {
await axiosInstance.post(`/bookmarks`, {
postId,
});
};

export const removeBookmarkPost = async (postId: string): Promise<void> => {
await axiosInstance.delete(`/bookmarks?postId=${postId}`);
};
50 changes: 0 additions & 50 deletions client/src/apis/interceptors/refresh.ts

This file was deleted.

Loading

0 comments on commit 9b2f22d

Please sign in to comment.