-
Notifications
You must be signed in to change notification settings - Fork 0
[chore] CI/CD 파이프라인 구축 (#1) #2
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
The head ref may contain hidden characters: "chore/#1-ci-cd-\uAD6C\uCD95"
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2300646
chore: package.json에 format:check 스크립트 추가
2seb2 2437177
chore: PR CI 및 프론트엔드 배포 파이프라인 추가
2seb2 cbf52f2
chore: GitHub Actions에 corepack enable 추가
2seb2 45daad8
chore: corepack enable을 setup-node 이전으로 이동
2seb2 e02db84
chore: ESLint에서 .yarn 및 .pnp 파일 제외
2seb2 ea8336d
chore: prettierignore 추가 및 이슈 템플릿 포맷 수정
2seb2 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 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
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,42 @@ | ||
| name: Frontend Deploy | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| # main에 머지(push)될 때 실행 | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - run: corepack enable | ||
| # package.json의 packageManager 버전(yarn berry)으로 자동 전환 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: yarn | ||
|
|
||
| - run: yarn install --immutable | ||
| - run: yarn build | ||
| # dist/ 폴더 생성 | ||
|
|
||
| - uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| aws-region: ${{ secrets.AWS_REGION }} | ||
| # GitHub Secrets에 저장한 AWS 키로 인증 | ||
|
2seb2 marked this conversation as resolved.
|
||
|
|
||
| - name: S3 업로드 | ||
| run: aws s3 sync dist/ s3://${{ secrets.S3_BUCKET }} --delete | ||
| # dist/ 폴더를 S3에 동기화 | ||
| # --delete: S3에만 있고 dist/에 없는 파일은 삭제 (이전 빌드 파일 정리) | ||
|
|
||
| - name: CloudFront 캐시 무효화 | ||
| run: | | ||
| aws cloudfront create-invalidation \ | ||
| --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} \ | ||
| --paths "/*" | ||
| # 전체 캐시 무효화 → 사용자가 새 빌드 파일을 즉시 받을 수 있게 | ||
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,38 @@ | ||
| name: PR CI | ||
| # GitHub Actions 탭에 표시되는 이름 | ||
|
|
||
| on: | ||
| pull_request: | ||
| # base branch 제한 없이 PR이면 CI 수행 | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| # GitHub이 제공하는 우분투 서버에서 실행 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| # 레포 코드를 서버에 내려받기 | ||
|
|
||
| - run: corepack enable | ||
| # package.json의 packageManager 버전(yarn berry)으로 자동 전환 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: yarn | ||
| # Node.js 22 설치, yarn 캐시 활성화 (두 번째 실행부터 빠름) | ||
|
|
||
| - run: yarn install --immutable | ||
| # yarn.lock 기준으로 설치, lock 파일 변경 불가 (CI 안전장치) | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - run: yarn lint | ||
| # ESLint 검사 (console.log 등 룰 위반 시 실패) | ||
|
|
||
| - run: yarn format:check | ||
| # Prettier 포맷 검사 (포맷 안 맞으면 실패) | ||
|
|
||
| - run: yarn build | ||
| # TypeScript 타입체크 + Vite 빌드 (둘 중 하나라도 실패하면 머지 불가) | ||
|
|
||
| # - run: yarn test | ||
| # 테스트 추가되면 활성화 | ||
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,4 @@ | ||
| dist | ||
| .yarn | ||
| .pnp.cjs | ||
| .pnp.loader.mjs |
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.