-
Notifications
You must be signed in to change notification settings - Fork 0
프론트엔드 인프라 재구축 #98
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
Merged
프론트엔드 인프라 재구축 #98
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
4cb5b2f
feat : eslint 및 prettier 적용
ohamin26 0a2d1ae
chore : 프로젝트 전체 eslint 및 prettier 규칙 적용
ohamin26 5899ea6
chore : 노드 버전 명시
ohamin26 2c76e6c
feat : ci workflow 추가
ohamin26 2cf3a02
fix : ci workflow pnpm 의존성 추가 및 feat 브랜치 추가
ohamin26 36055d1
fix : ci workflow 중복 실행 버그 수정
ohamin26 2cc6c7d
feat : 배포 자동화 qa 서버 추가 (테스트)
ohamin26 4c5ce9d
fix : ci 빌드 오류 수정
ohamin26 eddf518
fix : 자동 배포 s3 업로드 버그 수정
ohamin26 634b454
feat : 배포 자동화 (qa 서버 테스트)
ohamin26 ee24709
fix : 배포 자동화 codedeploy workflow 수정
ohamin26 24173c7
fix : 배포 자동화 workflow ec2 deploy 문법 오류 수정
ohamin26 c5d0e7a
fix : 배포 자동화 workflow 오타 수정
ohamin26 1ef2541
fix : 배포 자동화 workflow codeploy 문법 오류 수정
ohamin26 65951fe
fix : appspec, after_install 배포 명령어 수정
ohamin26 83af8d6
fix : after_install 로직 수정
ohamin26 e026596
fix : after_install 문법 오류 수정
ohamin26 4f59313
fix : after_install pm2 프로세스 못찾는 버그 수정
ohamin26 b584406
fix : codedeploy script pm2 프로세스 인식 못하는 버그 수정
ohamin26 b7d0284
fix : appsepc aws 권한 변경
ohamin26 c73971e
fix : aws 권한 변경에 따른 명령어 수정
ohamin26 4b703e0
fix : after_install nvm 버전 명시 추가
ohamin26 108144f
fix : aws 권한 롤백
ohamin26 c6fcac4
fix : after_install nvm 경로 지정 로직 변경
ohamin26 910321b
feat : after_install pnpm 버전 명시 추가
ohamin26 d76aadf
feat : after_install pm2 경로 명시 추가
ohamin26 d86086b
fix : after_install 패키지 설치 명령어 수정
ohamin26 c993f7d
fix : after_install 패키지 설치 명령어 롤백
ohamin26 273b1d2
fix : after_install 패키지 설치 pm2 실행 명령어 ubuntu 권한 실행으로 변경
ohamin26 666e243
fix : after_install 패키지 설치 안되는 버그 수정
ohamin26 27b4ae1
fix : after_install pm2 command not found 버그 수정
ohamin26 5d27b27
fix: after_install nvm shell script 실행 경로 수정
ohamin26 c78f059
feat: ci/cd workflow dev / prod 수정 및 추가
ohamin26 19dd303
fix: after_install 코드 정리
ohamin26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/*" | ||
|
|
||
| - 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 22.4.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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], | ||
| }, | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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로 돼있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
질문이 이해가 잘 안됩니다
폴더 구조랑 압축 파일명이랑 상관이 있나요???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 아닙니다!! 다시 확인해보니 괜찮은 것 같습니다. 수고하셨습니다!