Skip to content

Commit 7ecd2e7

Browse files
authored
Merge pull request #231 from DDD-Community/develop
운영배포: QA(12/29 ~ 1/4) 반영 건들 배포
2 parents 3310b8a + 940cca2 commit 7ecd2e7

File tree

314 files changed

+28488
-5515
lines changed

Some content is hidden

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

314 files changed

+28488
-5515
lines changed

.github/workflows/deploy.yml

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,40 @@ name: Deploy Next.js to ECS
22

33
on:
44
push:
5-
branches: main
6-
5+
branches:
6+
- main
7+
- develop
78

89
env:
910
AWS_REGION: ap-northeast-2
1011
ECR_REPOSITORY: growit-fe
1112

1213
jobs:
14+
# 1. 환경 결정
15+
setup:
16+
name: Determine Environment
17+
runs-on: ubuntu-latest
18+
outputs:
19+
environment: ${{ steps.set-env.outputs.environment }}
20+
image_tag: ${{ steps.set-env.outputs.image_tag }}
21+
steps:
22+
- name: Set environment based on branch
23+
id: set-env
24+
run: |
25+
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
26+
echo "environment=production" >> $GITHUB_OUTPUT
27+
echo "image_tag=prod-${{ github.sha }}" >> $GITHUB_OUTPUT
28+
else
29+
echo "environment=development" >> $GITHUB_OUTPUT
30+
echo "image_tag=dev-${{ github.sha }}" >> $GITHUB_OUTPUT
31+
fi
32+
33+
# 2. Docker 이미지 빌드 및 ECR 푸시
1334
build-and-push:
14-
environment: production # Environments에서 Required reviewers 설정 가능
1535
name: Build and Push Docker Image
1636
runs-on: ubuntu-latest
37+
needs: setup
38+
environment: ${{ needs.setup.outputs.environment }}
1739
outputs:
1840
image: ${{ steps.build-image.outputs.image }}
1941
steps:
@@ -37,23 +59,23 @@ jobs:
3759
id: build-image
3860
env:
3961
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
40-
IMAGE_TAG: ${{ github.ref_name }}
62+
IMAGE_TAG: ${{ needs.setup.outputs.image_tag }}
4163
run: |
4264
IMAGE="$ECR_REGISTRY/${{ env.ECR_REPOSITORY }}:$IMAGE_TAG"
43-
echo "Building $IMAGE"
65+
echo "Building $IMAGE for ${{ needs.setup.outputs.environment }}"
4466
docker build \
4567
--build-arg NEXT_PUBLIC_API_URL=${{ vars.NEXT_PUBLIC_API_URL }} \
4668
--build-arg NEXT_PUBLIC_REDIRECT_URL=${{ vars.NEXT_PUBLIC_REDIRECT_URL }} \
4769
-t "$IMAGE" .
4870
docker push "$IMAGE"
4971
echo "image=$IMAGE" >> $GITHUB_OUTPUT
5072
51-
# 3) PROD 배포: (A) 릴리스 태그 or (B) hotfix-* 브랜치 푸시
52-
deploy-prod:
53-
name: Deploy to PROD ECS
73+
# 3. ECS 배포
74+
deploy:
75+
name: Deploy to ECS (${{ needs.setup.outputs.environment }})
5476
runs-on: ubuntu-latest
55-
needs: build-and-push
56-
environment: production # Environments에서 Required reviewers 설정 가능
77+
needs: [setup, build-and-push]
78+
environment: ${{ needs.setup.outputs.environment }}
5779
steps:
5880
- name: Checkout
5981
uses: actions/checkout@v4
@@ -67,37 +89,35 @@ jobs:
6789
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
6890
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6991

70-
71-
- name: Set container name (with default)
72-
run: echo "CONTAINER_NAME=growit-fe-container" >> $GITHUB_ENV
73-
7492
- name: Download task definition
7593
run: |
7694
aws ecs describe-task-definition \
77-
--task-definition "growit-fe-task" \
95+
--task-definition "${{ vars.ECS_TASK_DEFINITION }}" \
7896
--query taskDefinition > task-definition.json
7997
80-
- name: Render taskdef (prod)
98+
- name: Render task definition
8199
id: task-def
82100
uses: aws-actions/amazon-ecs-render-task-definition@v1
83101
with:
84102
task-definition: task-definition.json
85-
container-name: growit-fe-container
103+
container-name: ${{ vars.ECS_CONTAINER_NAME }}
86104
image: ${{ needs.build-and-push.outputs.image }}
87105

88-
- name: Deploy to ECS (PROD)
106+
- name: Deploy to ECS
89107
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
90108
with:
91109
task-definition: ${{ steps.task-def.outputs.task-definition }}
92-
service: growit-fe-task-service-3
110+
service: ${{ vars.ECS_SERVICE }}
93111
cluster: growit-fe-cluster
94112
wait-for-service-stability: false
95113

96-
- name: Set tag info (PROD)
97-
id: tag-info
114+
- name: Deployment Summary
98115
run: |
99-
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
100-
echo "tag_info=태그: $GITHUB_REF_NAME" >> $GITHUB_OUTPUT
101-
else
102-
echo "tag_info=브랜치: $GITHUB_REF_NAME" >> $GITHUB_OUTPUT
103-
fi
116+
echo "## 🚀 배포 완료" >> $GITHUB_STEP_SUMMARY
117+
echo "" >> $GITHUB_STEP_SUMMARY
118+
echo "| 항목 | 값 |" >> $GITHUB_STEP_SUMMARY
119+
echo "|------|-----|" >> $GITHUB_STEP_SUMMARY
120+
echo "| **환경** | ${{ needs.setup.outputs.environment }} |" >> $GITHUB_STEP_SUMMARY
121+
echo "| **브랜치** | ${{ github.ref_name }} |" >> $GITHUB_STEP_SUMMARY
122+
echo "| **커밋** | ${{ github.sha }} |" >> $GITHUB_STEP_SUMMARY
123+
echo "| **이미지** | ${{ needs.build-and-push.outputs.image }} |" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ next-env.d.ts
4747
storybook-static
4848

4949
# readme
50-
CLAUDE_README.md
50+
CLAUDE_README.md
51+
52+
# expo
53+
/bottom-sheet-test

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ app → composite → feature → shared
5353

5454
## 🌐 페이지 URL 구조
5555

56-
| URL | 페이지 | 설명 |
57-
| ------------------- | ---------------- | --------------------------------------- |
58-
| `/` | 랜딩 페이지 | 토큰 확인 후 적절한 페이지로 리다이렉션 |
59-
| `/login` | 로그인 페이지 | 사용자 로그인 |
60-
| `/signup` | 회원가입 페이지 | 새로운 사용자 등록 |
61-
| `/home` | 메인 대시보드 | 사용자 목표 목록 및 관리 |
62-
| `/home/create-goal` | 목표 생성 페이지 | 새로운 목표 생성 |
56+
| URL | 페이지 | 설명 |
57+
| -------------- | ---------------- | --------------------------------------- |
58+
| `/` | 랜딩 페이지 | 토큰 확인 후 적절한 페이지로 리다이렉션 |
59+
| `/login` | 로그인 페이지 | 사용자 로그인 |
60+
| `/signup` | 회원가입 페이지 | 새로운 사용자 등록 |
61+
| `/home` | 메인 대시보드 | 사용자 목표 목록 및 관리 |
62+
| `/goal/create` | 목표 생성 페이지 | 새로운 목표 생성 |
6363

6464
## 📂 폴더별 기능 설명
6565

knip.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema.json",
3+
"ignoreExportsUsedInFile": {
4+
"interface": true,
5+
"type": true
6+
},
7+
"tags": [
8+
"-lintignore"
9+
]
10+
}

mocks/domain/todo.ts

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { http, HttpResponse } from 'msw';
22
import { Todo, DAY_OF_THE_WEEK } from '@/shared/type/Todo';
3-
import { Goal, GoalCategoryEnum } from '@/shared/type/goal';
43

54
// CORS preflight 요청 처리
65
export const optionsHandler = http.options('*', () => {
@@ -14,79 +13,6 @@ export const optionsHandler = http.options('*', () => {
1413
});
1514
});
1615

17-
// 테스트용 Goal 데이터
18-
export const mockGoals: Goal[] = [
19-
{
20-
id: 'goal-1',
21-
name: '프론트엔드 개발 마스터하기',
22-
mentor: 'TIM_COOK',
23-
duration: {
24-
startDate: '2024-01-01',
25-
endDate: '2024-03-31',
26-
},
27-
toBe: 'React 전문가가 되어 프로젝트를 주도할 수 있음',
28-
category: GoalCategoryEnum.STUDY,
29-
plans: [
30-
{
31-
id: 'plan-1',
32-
content: 'React 컴포넌트 설계 및 리팩토링',
33-
weekOfMonth: 1,
34-
},
35-
{
36-
id: 'plan-2',
37-
content: 'TypeScript와 React 연동',
38-
weekOfMonth: 2,
39-
},
40-
],
41-
},
42-
{
43-
id: 'goal-2',
44-
name: '디자인 시스템 구축',
45-
mentor: 'CONFUCIUS',
46-
duration: {
47-
startDate: '2024-01-15',
48-
endDate: '2024-02-28',
49-
},
50-
toBe: '일관성 있는 디자인 시스템',
51-
category: GoalCategoryEnum.FINANCE,
52-
plans: [
53-
{
54-
id: 'plan-3',
55-
content: '디자인 토큰 정의 및 컴포넌트 설계',
56-
weekOfMonth: 1,
57-
},
58-
{
59-
id: 'plan-4',
60-
content: '스토리북을 활용한 컴포넌트 문서화',
61-
weekOfMonth: 2,
62-
},
63-
],
64-
},
65-
{
66-
id: 'goal-3',
67-
name: '프로젝트 관리 역량 강화',
68-
mentor: 'WARREN_BUFFETT',
69-
duration: {
70-
startDate: '2024-01-01',
71-
endDate: '2024-04-30',
72-
},
73-
toBe: '프로젝트를 기획하고 관리할 수 있는 역량',
74-
category: GoalCategoryEnum.STUDY,
75-
plans: [
76-
{
77-
id: 'plan-5',
78-
content: '프로젝트 기획 및 요구사항 분석',
79-
weekOfMonth: 1,
80-
},
81-
{
82-
id: 'plan-6',
83-
content: '팀 협업 및 커뮤니케이션',
84-
weekOfMonth: 2,
85-
},
86-
],
87-
},
88-
];
89-
9016
// 테스트용 Todo 데이터 (요일별로 구성)
9117
export const mockTodosByPlan: Record<string, Record<DAY_OF_THE_WEEK, Todo[]>> = {
9218
'plan-1': {
@@ -266,24 +192,6 @@ const getAllTodos = (): Todo[] => {
266192
return Object.values(mockTodosByPlan).flatMap(planTodos => Object.values(planTodos).flat());
267193
};
268194

269-
// Goal 목록 조회
270-
export const getGoals = http.get('/mock/goals', () => {
271-
return HttpResponse.json(
272-
{
273-
data: mockGoals,
274-
message: 'Goal 목록을 성공적으로 조회했습니다.',
275-
},
276-
{
277-
status: 200,
278-
headers: {
279-
'Access-Control-Allow-Origin': '*',
280-
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
281-
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
282-
},
283-
}
284-
);
285-
});
286-
287195
// 주간 Todo 리스트 조회 (요일별로 그룹화)
288196
export const getWeeklyTodoList = http.get('/mock/todos', ({ request }) => {
289197
const url = new URL(request.url);
@@ -690,7 +598,6 @@ function getDayOfWeek(dateString: string): DAY_OF_THE_WEEK {
690598
// 모든 Todo 핸들러들을 배열로 export
691599
export const todoHandlers = [
692600
optionsHandler,
693-
getGoals,
694601
getWeeklyTodoList,
695602
getTodos,
696603
getTodoById,

mocks/handlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { http, HttpResponse } from 'msw';
2-
import { todoHandlers } from './domain/todo';
2+
//import { todoHandlers } from './domain/todo';
33
import { getContribution } from '../src/composite/home/contributionGraph/api';
44

55
// 테스트용 더미 데이터
@@ -73,4 +73,4 @@ const getJobRoles = http.get('/resource/jobroles', () => {
7373
});
7474

7575
// 이 배열에 api 함수들을 넣어 작동
76-
export const handlers = [getUsers, login, reissue, getJobRoles, getContribution, ...todoHandlers];
76+
export const handlers = [getUsers, login, reissue, getJobRoles, getContribution];

next.config.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
import type { NextConfig } from 'next';
22

33
const nextConfig: NextConfig = {
4-
/* config options here */
5-
plugins: {
6-
'@tailwindcss/postcss': {},
4+
eslint: {
5+
// 프로덕션 빌드 시 ESLint 에러 무시
6+
ignoreDuringBuilds: true,
7+
},
8+
typescript: {
9+
// 타입 체크 에러는 경고로만 처리
10+
ignoreBuildErrors: false,
11+
},
12+
images: {
13+
remotePatterns: [
14+
{
15+
protocol: 'https',
16+
hostname: 'growit-images.s3.ap-northeast-2.amazonaws.com',
17+
port: '',
18+
pathname: '/**',
19+
},
20+
],
721
},
822
};
923

0 commit comments

Comments
 (0)