Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4cb5b2f
feat : eslint 및 prettier 적용
ohamin26 May 17, 2025
0a2d1ae
chore : 프로젝트 전체 eslint 및 prettier 규칙 적용
ohamin26 May 17, 2025
5899ea6
chore : 노드 버전 명시
ohamin26 May 17, 2025
2c76e6c
feat : ci workflow 추가
ohamin26 May 17, 2025
2cf3a02
fix : ci workflow pnpm 의존성 추가 및 feat 브랜치 추가
ohamin26 May 17, 2025
36055d1
fix : ci workflow 중복 실행 버그 수정
ohamin26 May 17, 2025
2cc6c7d
feat : 배포 자동화 qa 서버 추가 (테스트)
ohamin26 May 17, 2025
4c5ce9d
fix : ci 빌드 오류 수정
ohamin26 May 17, 2025
eddf518
fix : 자동 배포 s3 업로드 버그 수정
ohamin26 May 17, 2025
634b454
feat : 배포 자동화 (qa 서버 테스트)
ohamin26 May 17, 2025
ee24709
fix : 배포 자동화 codedeploy workflow 수정
ohamin26 May 17, 2025
24173c7
fix : 배포 자동화 workflow ec2 deploy 문법 오류 수정
ohamin26 May 17, 2025
c5d0e7a
fix : 배포 자동화 workflow 오타 수정
ohamin26 May 17, 2025
1ef2541
fix : 배포 자동화 workflow codeploy 문법 오류 수정
ohamin26 May 17, 2025
65951fe
fix : appspec, after_install 배포 명령어 수정
ohamin26 May 17, 2025
83af8d6
fix : after_install 로직 수정
ohamin26 May 17, 2025
e026596
fix : after_install 문법 오류 수정
ohamin26 May 17, 2025
4f59313
fix : after_install pm2 프로세스 못찾는 버그 수정
ohamin26 May 17, 2025
b584406
fix : codedeploy script pm2 프로세스 인식 못하는 버그 수정
ohamin26 May 17, 2025
b7d0284
fix : appsepc aws 권한 변경
ohamin26 May 19, 2025
c73971e
fix : aws 권한 변경에 따른 명령어 수정
ohamin26 May 19, 2025
4b703e0
fix : after_install nvm 버전 명시 추가
ohamin26 May 19, 2025
108144f
fix : aws 권한 롤백
ohamin26 May 19, 2025
c6fcac4
fix : after_install nvm 경로 지정 로직 변경
ohamin26 May 23, 2025
910321b
feat : after_install pnpm 버전 명시 추가
ohamin26 May 23, 2025
d76aadf
feat : after_install pm2 경로 명시 추가
ohamin26 May 23, 2025
d86086b
fix : after_install 패키지 설치 명령어 수정
ohamin26 May 23, 2025
c993f7d
fix : after_install 패키지 설치 명령어 롤백
ohamin26 May 23, 2025
273b1d2
fix : after_install 패키지 설치 pm2 실행 명령어 ubuntu 권한 실행으로 변경
ohamin26 May 23, 2025
666e243
fix : after_install 패키지 설치 안되는 버그 수정
ohamin26 May 23, 2025
27b4ae1
fix : after_install pm2 command not found 버그 수정
ohamin26 May 23, 2025
5d27b27
fix: after_install nvm shell script 실행 경로 수정
ohamin26 May 23, 2025
c78f059
feat: ci/cd workflow dev / prod 수정 및 추가
ohamin26 May 23, 2025
19dd303
fix: after_install 코드 정리
ohamin26 May 23, 2025
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
41 changes: 0 additions & 41 deletions .eslintrc.json

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

permissions:
id-token: write

jobs:
build:
env:
ENV_PATH: .env
environment: Production
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.14.0

# Install
- name: Install Dependencies
run: pnpm install

# Test - test를 진행하지 않으므로 생략
# - name: Run Tests
# run: pnpm test

# Lint
- name: Lint Code
run: pnpm lint

- name: Create .env file
run: |
touch ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_API_MOCKING=${{ secrets.NEXT_PUBLIC_API_MOCKING }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_GOOGLE_API_KEY=${{ secrets.NEXT_PUBLIC_GOOGLE_API_KEY }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_GOOGLE_LOGIN_REDIRECT_URI=${{ secrets.NEXT_PUBLIC_GOOGLE_LOGIN_REDIRECT_URI }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_IMAGE_BASE_PATH=${{ secrets.NEXT_PUBLIC_IMAGE_BASE_PATH }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_JUULABEL_API_URL=${{ secrets.NEXT_PUBLIC_JUULABEL_API_URL }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_KAKAO_API_KEY=${{ secrets.NEXT_PUBLIC_KAKAO_API_KEY }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_KAKAO_LOGIN_REDIRECT_URI=${{ secrets.NEXT_PUBLIC_KAKAO_LOGIN_REDIRECT_URI }} >> ${{ env.ENV_PATH }}

# Build
- name: Build Project
run: pnpm build
66 changes: 66 additions & 0 deletions .github/workflows/deploy.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
pull_request:
branches: [release/*]
types: [closed]

jobs:
deploy:
if: github.event.pull_request.merged == true
env:
ENV_PATH: .env
environment: Develop
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Create .env file
run: |
touch ${{ env.ENV_PATH }}
echo ENV_VERSION='dev' >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_API_MOCKING=${{ secrets.NEXT_PUBLIC_API_MOCKING }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_GOOGLE_API_KEY=${{ secrets.NEXT_PUBLIC_GOOGLE_API_KEY }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_GOOGLE_LOGIN_REDIRECT_URI=${{ secrets.NEXT_PUBLIC_GOOGLE_LOGIN_REDIRECT_URI }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_IMAGE_BASE_PATH=${{ secrets.NEXT_PUBLIC_IMAGE_BASE_PATH }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_JUULABEL_API_URL=${{ secrets.NEXT_PUBLIC_JUULABEL_API_URL }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_KAKAO_API_KEY=${{ secrets.NEXT_PUBLIC_KAKAO_API_KEY }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_KAKAO_LOGIN_REDIRECT_URI=${{ secrets.NEXT_PUBLIC_KAKAO_LOGIN_REDIRECT_URI }} >> ${{ env.ENV_PATH }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.14.0
run_install: false

- name: Install Dependencies
run: pnpm install

- name: Build Project
run: pnpm build

- name: ZIP project files
run: |
zip -r juulabel-front-qa.zip . -x "*.git*" "node_modules/*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 qa서버 폴더 구조가 /home/juulabel-qa/juulabel-front이거로 돼있는데, 현재 압축 하는 이름은 juulabel-front-qa로 돼있습니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문이 이해가 잘 안됩니다
폴더 구조랑 압축 파일명이랑 상관이 있나요???

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 아닙니다!! 다시 확인해보니 괜찮은 것 같습니다. 수고하셨습니다!


- name: Acces to AWS
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Upload to S3
run: |
aws s3 cp ./juulabel-front-qa.zip s3://${{ secrets.S3_BUCKET }}/juulabel-front-qa.zip

- name: Deploy to EC2
run: aws deploy create-deployment
--application-name ${{ secrets.CODEDEPLOY_APPLICATION_NAME }}
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name ${{ secrets.CODEDEPLOY_GROUP_NAME }}
--s3-location bucket=${{ secrets.S3_BUCKET }},key=juulabel-front-qa.zip,bundleType=zip
67 changes: 67 additions & 0 deletions .github/workflows/deploy.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
pull_request:
branches: [main]
types: [closed]

jobs:
deploy:
if: github.event.pull_request.merged == true
env:
ENV_PATH: .env
environment: Production
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Create .env file
run: |
touch ${{ env.ENV_PATH }}
echo ENV_VERSION='production' >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_API_MOCKING=${{ secrets.NEXT_PUBLIC_API_MOCKING }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_GOOGLE_API_KEY=${{ secrets.NEXT_PUBLIC_GOOGLE_API_KEY }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_GOOGLE_LOGIN_REDIRECT_URI=${{ secrets.NEXT_PUBLIC_GOOGLE_LOGIN_REDIRECT_URI }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_IMAGE_BASE_PATH=${{ secrets.NEXT_PUBLIC_IMAGE_BASE_PATH }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_JUULABEL_API_URL=${{ secrets.NEXT_PUBLIC_JUULABEL_API_URL }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_KAKAO_API_KEY=${{ secrets.NEXT_PUBLIC_KAKAO_API_KEY }} >> ${{ env.ENV_PATH }}
echo NEXT_PUBLIC_KAKAO_LOGIN_REDIRECT_URI=${{ secrets.NEXT_PUBLIC_KAKAO_LOGIN_REDIRECT_URI }} >> ${{ env.ENV_PATH }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.14.0
run_install: false

- name: Install Dependencies
run: pnpm install

- name: Build Project
run: pnpm build

- name: ZIP project files
run: |
zip -r juulabel-front.zip . -x "*.git*" "node_modules/*"

- name: Acces to AWS
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Upload to S3
run: |
aws s3 cp ./juulabel-front.zip s3://${{ secrets.S3_BUCKET }}/juulabel-front.zip

- name: Deploy to EC2
run: |
aws deploy create-deployment
--application-name ${{ secrets.CODEDEPLOY_APPLICATION_NAME }}
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name ${{ secrets.CODEDEPLOY_GROUP_NAME }}
--s3-location bucket=${{ secrets.S3_BUCKET }}, bundleType=zip, key=juulabel-front.zip
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.4.0
11 changes: 10 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"tabWidth": 2
"singleQuote": true,
"parser": "typescript",
"semi": true,
"useTabs": false,
"tabWidth": 2,
"printWidth": 120,
"arrowParens": "always",
"trailingComma": "all",
"bracketSpacing": true,
"endOfLine": "auto"
}
17 changes: 17 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 0.0
os: linux
files:
- source: /
destination: /home/juulabel-front
file_exists_behavior: OVERWRITE
permissions:
- object: /home/juulabel-front
pattern: "**"
owner: root
group: root
mode: 755
hooks:
AfterInstall:
- location: scripts/after_install.sh
timeout: 300
runas: root
70 changes: 70 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import tseslint from "typescript-eslint";
import eslint from "@eslint/js";
import react from "eslint-plugin-react";
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
import next from "@next/eslint-plugin-next";
import eslintPluginPrettier from "eslint-plugin-prettier";
import globals from "globals";

export default tseslint.config(
{
ignores: [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"**/public/**",
"**/.next/**",
"**/.github/**",
"**/tailwind.config.js",
"**/postcss.config.js",
"**/next.config.js",
"**/next-env.d.ts",
],
},
eslint.configs.recommended,
...tseslint.configs.recommended,

{
files: ["**/*.ts", "**/*.tsx"],
plugins: {
"@typescript-eslint": typescriptPlugin,
react,
next,
prettier: eslintPluginPrettier,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
},
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off", // React import를 사용하지 않도록 설정

"prettier/prettier": "warn", // Prettier 규칙을 ESLint에서 경고로 설정

"@typescript-eslint/no-unused-vars": "off", // 사용하지 않는 변수 허용

"@typescript-eslint/no-explicit-any": "off", // any 타입 사용 허용
"@typescript-eslint/no-require-imports": "off", // require 사용 허용

"react/no-unescaped-entities": "off", // React 컴포넌트에서 엔티티를 직접 사용하는 것을 허용
"@typescript-eslint/no-non-null-assertion": "off", // non-null assertion 사용 허용
"@next/next/no-page-custom-font": "off", // next.js에서 커스텀 폰트 사용을 허용
"react/jsx-filename-extension": [
1,
{
extensions: [".ts", ".tsx"],
}, // ts파일에서 tsx 문법 사용 허용
],
},
},
{
extends: [tseslint.configs.disableTypeChecked],
},
);
23 changes: 21 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "cross-env NODE_ENV=production next build",
"start": "cross-env NODE_ENV=production PORT=5001 next start",
"start:qa": "cross-env NODE_ENV=production PORT=5005 next start",
"lint": "next lint",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"check-code": "prettier --check .",
"format": "prettier --write ."
},
Expand Down Expand Up @@ -44,7 +45,10 @@
"zustand": "^4.5.6"
},
"devDependencies": {
"@eslint/js": "^9.26.0",
"@next/eslint-plugin-next": "^15.3.2",
"@svgr/webpack": "^8.1.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/event-source-polyfill": "^1.0.5",
"@types/node": "^20.17.24",
"@types/react": "^18.3.18",
Expand All @@ -58,17 +62,32 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-react": "^7.37.4",
"globals": "^16.1.0",
"msw": "^2.7.3",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"prettier-plugin-tailwindcss": "^0.6.11",
"tailwindcss": "^3.4.17",
"typescript": "^5.8.2",
"typescript-eslint": "^8.32.0",
"workbox-webpack-plugin": "^7.3.0"
},
"prettier": {
"plugins": [
"prettier-plugin-tailwindcss"
"prettier-plugin-tailwindcss",
"@trivago/prettier-plugin-sort-imports"
],
"importOrder": [
"<THIRD_PARTY_MODULES>",
"^@/app/(.*)$",
"^@/_components/(.*)$",
"^@/_common/(.*)$",
"^@/_lib/(.*)$",
"^@/_store/(.*)$",
"^@/_types/(.*)$",
"^@/_utils/(.*)$",
"^@/(.*)$",
"^[./]"
],
"tailwindConfig": "./tailwind.config.ts"
},
Expand Down
Loading
Loading