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

dev-be, dev-fe를 main으로 합치는 PR #91

Merged
merged 10 commits into from
Nov 12, 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
80 changes: 80 additions & 0 deletions .github/workflows/BACKEND_DEPLOY.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: 백엔드 배포
on:
push:
branches: [main]
paths:
- "packages/backend/**"
- "packages/shared/**"
jobs:
push_to_registry:
runs-on: ubuntu-latest
steps:
- name: 코드 체크아웃
uses: actions/checkout@v3

- name: Docker Buildx 설정
uses: docker/setup-buildx-action@v2

- name: NCP 컨테이너 레지스트리 로그인
uses: docker/login-action@v2
with:
registry: ${{ secrets.CONTAINER_REGISTRY_URL }}
username: ${{ secrets.NCP_ACCESS_KEY }}
password: ${{ secrets.NCP_SECRET_KEY }}

- name: 도커 이미지 빌드 및 푸시 (Blue)
id: docker-build-blue
uses: docker/build-push-action@v3
with:
context: .
file: ./packages/backend/Dockerfile.blue
push: true
tags: ${{ secrets.CONTAINER_REGISTRY_URL }}/backend:blue-latest

- name: 도커 이미지 빌드 및 푸시 (Green)
id: docker-build-green
uses: docker/build-push-action@v3
with:
context: .
file: ./packages/backend/Dockerfile.green
push: true
tags: ${{ secrets.CONTAINER_REGISTRY_URL }}/backend:green-latest

pull_from_registry:
runs-on: ubuntu-latest
needs: push_to_registry
steps:
- name: SSH로 서버 접속
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SERVER_SSH_PORT }}

- name: NCP 컨테이너 레지스트리 로그인
run: |
docker login -u ${{ secrets.NCP_ACCESS_KEY }} -p ${{ secrets.NCP_SECRET_KEY }} ${{ secrets.CONTAINER_REGISTRY_URL }}

- name: 현재 실행 중인 Blue/Green 확인
id: check-current
run: |
if docker ps --filter "name=backend_green" --format '{{.Names}}' | grep -w backend_green; then
echo "current=green" | tee -a $GITHUB_ENV
else
echo "current=blue" | tee -a $GITHUB_ENV
fi

- name: 컨테이너 업데이트 및 Blue/Green 전환
run: |
if [ "$current" = "green" ]; then
docker stop backend_green || true
docker rm backend_green || true
docker pull ${{ secrets.CONTAINER_REGISTRY_URL }}/backend:blue-latest
docker run -d --name backend_blue --network product_network -p 3000:3000 ${{ secrets.CONTAINER_REGISTRY_URL }}/backend:blue-latest
else
docker stop backend_blue || true
docker rm backend_blue || true
docker pull ${{ secrets.CONTAINER_REGISTRY_URL }}/backend:green-latest
docker run -d --name backend_blue --network product_network -p 3001:3000 ${{ secrets.CONTAINER_REGISTRY_URL }}/backend:blue-latest
fi
66 changes: 66 additions & 0 deletions .github/workflows/FRONTEND_DEPLOY.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 프론트엔드 배포
on:
push:
branches: [main]
paths:
- "packages/frontend/**"
- "packages/shared/**"

permissions:
contents: read
checks: write
pull-requests: write

jobs:
push_to_registry:
runs-on: ubuntu-latest
steps:
- name: 코드 체크아웃
uses: actions/checkout@v3

- name: NCP 컨테이너 레지스트리 로그인
uses: docker/login-action@v2
with:
registry: ${{ secrets.CONTAINER_REGISTRY_URL }}
username: ${{ secrets.NCP_ACCESS_KEY }}
password: ${{ secrets.NCP_SECRET_KEY }}

- name: 도커 이미지 빌드 및 푸시 (Blue)
id: docker-build-blue
uses: docker/build-push-action@v3
with:
context: .
file: ./packages/frontend/Dockerfile
push: true
tags: ${{ secrets.CONTAINER_REGISTRY_URL }}/frontend:latest

pull_from_registry:
runs-on: ubuntu-latest
needs: push_to_registry
steps:
- name: SSH로 서버 접속
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SERVER_SSH_PORT }}
script: |
# NCP 컨테이너 레지스트리 로그인
docker login -u ${{ secrets.NCP_ACCESS_KEY }} -p ${{ secrets.NCP_SECRET_KEY }} ${{ secrets.CONTAINER_REGISTRY_URL }}

# 새로운 이미지 pull
docker pull ${{ secrets.CONTAINER_REGISTRY_URL }}/frontend:latest

# 기존 컨테이너 중지 및 제거
docker stop frontend || true
docker rm frontend || true

# 새 컨테이너 실행
docker run -d --name frontend -p 80:80 ${{ secrets.CONTAINER_REGISTRY_URL }}/frontend:latest

# 헬스체크 (선택사항)
sleep 5
if ! curl -f http://localhost:80/health; then
echo "Warning: Health check failed after deployment"
fi
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# env
.env

# develop
*/backend/docker.compose.yml
63 changes: 40 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,55 @@
## 🐝 팀 소개

### 우리팀은 BUZZZZZ...✨입니다
## 🐝 HoneyFlow 서비스 소개

<div align="center">

| J077 김현진 | J082 나희진 | J095 문지후 | J108 박병주 | J218 전호균 |
|---|---|---|---|---|
|![enter image description here](https://avatars.githubusercontent.com/u/127650598?v=4)|![enter image description here](https://avatars.githubusercontent.com/u/105726712?v=4)|![enter image description here](https://avatars.githubusercontent.com/u/157210807?v=4)|![enter image description here](https://avatars.githubusercontent.com/u/62245207?v=4)|![enter image description here](https://avatars.githubusercontent.com/u/4702412?v=4)|
| BE | FE | FE | FE | FE
| [@fru1tworld](https://github.com/fru1tworld) |[@heegenie](https://github.com/heegenie)|[@CatyJazzy](https://github.com/CatyJazzy) |[@parkblo](https://github.com/parkblo) |[@hoqn](https://github.com/parkblo) |
<img width="894" alt="HoneyFlowIntro" src="https://github.com/user-attachments/assets/f4602545-e068-448e-beb3-d276d9ecc360">


<br/>

### 그라운드룰
<b>" Think Linked, Map Together "</b>

- [> 보러가기](https://github.com/boostcampwm-2024/web29-honeyflow/wiki/%EA%B7%B8%EB%9D%BC%EC%9A%B4%EB%93%9C%EB%A3%B0)

<br/>

## 🐝 HoneyFlow 서비스 소개
그동안 야생에서 해왔던 학습 정리, 어렵지 않으셨나요? 😣

### " Think Linked, Map Together "
내용의 "구조화"가 이루어지지 않았기 때문입니다. HoneyFlow가 해결합니다.

> 그동안 야생에서 해왔던 학습 정리, 어렵지 않으셨나요?
> 내용의 "구조화"가 이루어지지 않았기 때문입니다. HoneyFlow가 해결합니다.
<img width="894" alt="HoneyFlowIntro" src="https://github.com/user-attachments/assets/f4602545-e068-448e-beb3-d276d9ecc360">
|🔗 링크|[📜 노션](https://psychedelic-pumpkin-26b.notion.site/HoneyFlow-12a9594041ea80fc9ae3d4cff0b6cc3a)|[🎨 피그마](https://www.figma.com/design/Uewm0B9ooTzIyN1pY9ZFVl/HoneyFlow-UI?t=rGVV4Pe2usnsTZUp-1)|[📚 Wiki](https://github.com/boostcampwm-2024/web29-honeyflow/wiki)|
|:-:|:-:|:-:|:--:|

</div>

<br/>
<br/>

## 🐝 More Info
- [> 팀 노션 스페이스](https://psychedelic-pumpkin-26b.notion.site/HoneyFlow-12a9594041ea80fc9ae3d4cff0b6cc3a?pvs=4)
## 🐝 디렉토리 구조

```
📂 web29-honeyflow/
├── 📂 packages/ 모노레포의 패키지들이 위치
│ ├── 📂 backend/ 백엔드 관련 패키지
│ │ ├── 📂 src/
│ │ ├── 📄 package.json
│ │ └── 📄 tsconfig.json
│ ├── 📂 frontend/ 프론트엔드 관련 패키지
│ │ ├── 📂 src/
│ │ ├── 📄 package.json
│ │ └── 📄 tsconfig.json
│ └── 📂 shared/ 프론트엔드와 백엔드에서 공용으로 사용하는 패키지
├── 📄 eslint.config.mjs
├── 📄 pnpm-lock.yaml
├── 📄 package.json
└── 📄 tsconfig.json
```


## 🐝 팀 소개

### 우리팀은 BUZZZZZ...✨입니다


| J077 김현진 | J082 나희진 | J095 문지후 | J108 박병주 | J218 전호균 |
|---|---|---|---|---|
|![enter image description here](https://avatars.githubusercontent.com/u/127650598?v=4)|![enter image description here](https://avatars.githubusercontent.com/u/105726712?v=4)|![enter image description here](https://avatars.githubusercontent.com/u/157210807?v=4)|![enter image description here](https://avatars.githubusercontent.com/u/62245207?v=4)|![enter image description here](https://avatars.githubusercontent.com/u/4702412?v=4)|
| BE | FE | FE | FE | FE
| [@fru1tworld](https://github.com/fru1tworld) |[@heegenie](https://github.com/heegenie)|[@CatyJazzy](https://github.com/CatyJazzy) |[@parkblo](https://github.com/parkblo) |[@hoqn](https://github.com/parkblo) |



25 changes: 25 additions & 0 deletions be/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
56 changes: 56 additions & 0 deletions be/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
4 changes: 4 additions & 0 deletions be/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
Loading
Loading