Skip to content

Commit 9e9f6d7

Browse files
authored
Merge pull request #92 from boostcampwm-2022/dev
interface Release v0.0.1
2 parents 84d18bb + 431b7a3 commit 9e9f6d7

File tree

195 files changed

+31333
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+31333
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Bug, Refactor
3+
about: 버그, 리팩토링 이슈 템플릿
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## As-Is
11+
12+
(현재 어떤 상황인지)
13+
14+
## To-Be
15+
16+
(어떻게 되길 바라는지)

.github/ISSUE_TEMPLATE/etc.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Etc
3+
about: 기타 이슈 템플릿
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
# 이슈 내용
11+
12+
(자유 양식입니다)

.github/ISSUE_TEMPLATE/feat.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feat
3+
about: 기능 이슈 템플릿
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## 구현 기능
11+
12+
(구현하는 기능 설명)
13+
14+
## 참조
15+
16+
(기능 구현에 필요한 참조 소스, 설계 기록, 레퍼런스 등)

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
작업 중인 PR이라면 제목에 [WIP]을 작성해주세요.
2+
3+
# PR 목적 / 요약
4+
5+
6+
# 관련 이슈
7+
8+
9+
# 리뷰받고 싶은 부분 설명
10+
11+
12+
# 특이사항
13+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Backend Socket Server Deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
docker-build-push:
9+
runs-on: ubuntu-latest
10+
defaults:
11+
run:
12+
working-directory: ./backend/socket
13+
14+
steps:
15+
- name: repository의 파일을 가상 인스턴스로 복사합니다.
16+
uses: actions/checkout@v3
17+
18+
- name: docker 관련 로직 처리를 위한 buildx를 설치합니다.
19+
uses: docker/setup-buildx-action@v2
20+
21+
- name: docker hub에 로그인 합니다.
22+
uses: docker/login-action@v2
23+
with:
24+
username: ${{ secrets.DOCKER_HUB_ID }}
25+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
26+
27+
- name: docker 이미지를 build 및 push합니다.
28+
uses: docker/build-push-action@v3
29+
with:
30+
context: ./backend/socket
31+
push: true
32+
tags: ${{ secrets.DOCKER_SOCKET_IMAGE }}:${{ secrets.VERSION }}
33+
cache-from: type=gha
34+
cache-to: type=gha,mode=max
35+
36+
docker-run:
37+
needs: docker-build-push
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: 배포 서버에서 docker image를 받아서 container를 실행시킵니다.
42+
uses: appleboy/ssh-action@master
43+
with:
44+
username: ${{ secrets.SOCKET_SERVER_USER }}
45+
password: ${{ secrets.SOCKET_SERVER_PWD }}
46+
host: ${{ secrets.SOCKET_SERVER_HOST }}
47+
port: ${{ secrets.SOCKET_SERVER_PORT }}
48+
49+
script: |
50+
export CURRENT_CONTAINER=$(docker ps -aq -f "name=socket-server")
51+
docker stop $(echo $CURRENT_CONTAINER) && docker rm $(echo $CURRENT_CONTAINER)
52+
docker pull ${{ secrets.DOCKER_SOCKET_IMAGE }}:${{ secrets.VERSION }}
53+
docker run --name socket-server --restart always -d -p 8081:8081 ${{ secrets.DOCKER_SOCKET_IMAGE }}:${{ secrets.VERSION }}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Frontend Deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build-push:
9+
runs-on: ubuntu-latest
10+
defaults:
11+
run:
12+
working-directory: ./frontend
13+
14+
steps:
15+
- name: repository의 파일을 가상 인스턴스로 복사합니다.
16+
uses: actions/checkout@v3
17+
18+
- name: node 패키지를 caching 합니다.
19+
uses: actions/cache@v3
20+
with:
21+
path: "**/node_modules"
22+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
23+
restore-keys: |
24+
${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
25+
26+
- name: caching된 node 패키지가 없으면 설치합니다.
27+
if: steps.cache.outputs.cache-hit != 'true'
28+
run: yarn install
29+
30+
- name: front 파일을 build 합니다.
31+
run: yarn build
32+
33+
- name: build된 파일을 배포 서버에 복사합니다.
34+
uses: appleboy/scp-action@master
35+
with:
36+
host: ${{ secrets.NGINX_SERVER_HOST }}
37+
username: ${{ secrets.NGINX_SERVER_USER }}
38+
password: ${{ secrets.NGINX_SERVER_PWD }}
39+
port: ${{ secrets.NGINX_SERVER_PORT }}
40+
source: './frontend/build/*'
41+
target: '/root/interface/html'
42+
strip_components: 2
43+
rm: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
cd backend/rest && yarn lint && cd ../../backend/socket && yarn lint && cd ../../frontend && yarn lint

.husky/pre-push

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
origin_url="https://github.com/boostcampwm-2022/web14-interface.git"
5+
6+
url="$2"
7+
8+
if [ "$url" != "$origin_url" ]
9+
then
10+
exit 0
11+
fi
12+
13+
current_branch=$(git rev-parse --abbrev-ref HEAD)
14+
15+
if [ "$current_branch" == "main" -o "$current_branch" == "dev" ]
16+
then
17+
echo "do not push in dev or main branch"
18+
exit 1
19+
fi
20+
21+
cd server && yarn lint && yarn test
22+
23+
exit 0

.husky/prepare-commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
exec < /dev/tty && node_modules/.bin/git-cz --hook || true

0 commit comments

Comments
 (0)