Skip to content

[chore] CI/CD 파이프라인 구축 (#1)#2

Merged
2seb2 merged 6 commits intomainfrom
chore/#1-ci-cd-구축
Apr 21, 2026

Hidden character warning

The head ref may contain hidden characters: "chore/#1-ci-cd-\uad6c\ucd95"
Merged

[chore] CI/CD 파이프라인 구축 (#1)#2
2seb2 merged 6 commits intomainfrom
chore/#1-ci-cd-구축

Conversation

@2seb2
Copy link
Copy Markdown
Contributor

@2seb2 2seb2 commented Apr 21, 2026

#️⃣ 관련 이슈

연관된 이슈 번호를 적어주세요.
이슈를 함께 종료하려면 Closes #이슈번호 형식으로 작성해주세요.


⏰ 작업 시간

예상과 실제 시간이 다르다면 이유를 간단히 적어주세요.

  • 예상 작업 시간 : 5h
  • 실제 작업 시간 : 5h

💻 작업 내용

이번 작업에서 진행한 내용을 정리해주세요.

GitHub Actions

  • PR 생성 시 lint, format:check, build 자동 실행 (pr-ci.yml)
  • main 머지 시 S3 업로드 및 CloudFront 캐시 무효화 (front-deploy.yml)

AWS

  • S3 버킷 생성 (home-protect-client)
  • CloudFront 배포 생성 + OAC 연결 + 오류 페이지 설정
  • GitHub Secrets 등록

기타

  • format:check 스크립트 package.json에 추가
  • Branch Protection Rule 설정 (PR 필수, CI 통과 필수)

필요한 경우 스크린샷이나 캡처 화면을 함께 첨부해주세요.


🪏 작업하면서 고민한 부분

작업 중 겪은 문제나 고민, 그리고 그에 대한 해결 과정을 정리해주세요.
관련 트러블슈팅 문서가 있다면 링크로 연결해주세요.


👀 리뷰 포인트

리뷰어가 중점적으로 확인해주길 바라는 부분이 있다면 작성해주세요.


📘 참고 자료

작업하면서 참고한 문서, 링크, 자료가 있다면 작성해주세요.

Summary by CodeRabbit

  • 작업
    • 메인 브랜치 푸시 시 프론트엔드를 자동 빌드해 배포 스토리지와 동기화하고 전체 캐시를 무효화하는 배포 파이프라인이 추가되었습니다.
  • 새 기능
    • 모든 풀리퀘스트에서 린트·코드 형식 검사·빌드 검증을 자동으로 실행하는 CI 파이프라인이 추가되어 품질 검사가 자동화됩니다.
  • 문서/도구
    • package.json에 형식 검사 스크립트(format:check) 추가, Prettier 무시 목록(.prettierignore) 추가 및 린트 무시 항목 확장, 이슈 템플릿 전면부 포맷 소소한 정리.

2seb2 added 2 commits April 21, 2026 23:28
- prettier --check . 로 prettier 포맷 검사
- PR 생성 시 lint, format:check, build 자동 실행 (pr-ci.yml)
- main 머지 시 S3 업로드 및 CloudFront 캐시 무효화 (front-deploy.yml)
- format:check 스크립트 package.json에 추가
@2seb2 2seb2 added this to the M1 · UI 구현 milestone Apr 21, 2026
@2seb2 2seb2 self-assigned this Apr 21, 2026
@2seb2 2seb2 added the 🏗️ Infra 배포, Docker, Redis, CI/CD 설정 label Apr 21, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d9df948c-4104-4f43-bd1b-ebbad42d6285

📥 Commits

Reviewing files that changed from the base of the PR and between 45daad8 and ea8336d.

📒 Files selected for processing (3)
  • .github/ISSUE_TEMPLATE/issue-template.md
  • .prettierignore
  • eslint.config.js
✅ Files skipped from review due to trivial changes (3)
  • .prettierignore
  • .github/ISSUE_TEMPLATE/issue-template.md
  • eslint.config.js

📝 Walkthrough

Walkthrough

PR용 CI 워크플로우와 메인 브랜치 대상 프론트엔드 배포 워크플로우가 추가되었습니다. PR CI는 설치·린트·포맷 검사·빌드를 실행하고, 배포 워크플로우는 빌드 결과(dist/)를 S3로 동기화한 뒤 CloudFront 무효화를 수행합니다. package.jsonformat:check 스크립트가 추가되었습니다.

Changes

Cohort / File(s) Summary
워크플로우 — CI (PR 검사)
\.github/workflows/pr-ci.yml
Pull Request 이벤트에 대한 CI 워크플로우 추가: Node.js 22 + Corepack 설정, yarn install --immutable, yarn lint, yarn format:check, yarn build 실행 (yarn test는 주석 처리).
워크플로우 — 배포 (Frontend Deploy)
\.github/workflows/front-deploy.yml
main 브랜치 푸시 시 실행되는 배포 워크플로우 추가: Node.js 22 + Corepack, yarn install --immutable, yarn builddist/ 생성 후 AWS 자격증명으로 aws s3 sync dist/ s3://<S3_BUCKET> --delete 및 CloudFront 전체 경로(/*) 무효화.
패키지 스크립트
package.json
Prettier 기반 포맷 검사 스크립트 format:check (prettier --check .) 추가.
포맷/린트 무시 설정
.prettierignore, eslint.config.js
Prettier와 ESLint 전역 무시 목록에 dist, .yarn/, .pnp.cjs, .pnp.loader.mjs 등 빌드/패키지 아티팩트 추가.
이슈 템플릿 포맷 수정
.github/ISSUE_TEMPLATE/issue-template.md
프론트매터 따옴표 스타일 및 빈 줄 제거 등 포맷 정리 (내용 변경 없음).

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub Actions
    participant Node as Build (Node/Yarn)
    participant S3 as AWS S3
    participant CF as CloudFront

    Dev->>GH: push to main / open PR
    alt PR workflow
        GH->>Node: setup Node 22 + Corepack\nyarn install --immutable\nyarn lint\nyarn format:check\nyarn build
        Node-->>GH: build result / status
    else Deploy workflow (main)
        GH->>Node: setup Node 22 + Corepack\nyarn install --immutable\nyarn build -> dist/
        Node-->>GH: dist/
        GH->>S3: aws s3 sync dist/ -> s3://BUCKET --delete
        S3-->>GH: sync complete
        GH->>CF: create-invalidation "/*" (Distribution ID from Secrets)
        CF-->>GH: invalidation queued
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 깡충깡충 말하네,
푸시하니 검사와 빌드가 반짝,
dist/에 모여 구름(CloudFront)으로 날아가요,
S3에 당근처럼 꽂히고, 무효화는 찰칵!
배포의 춤을 같이 춰요 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 CI/CD 파이프라인 구축이라는 주요 변경사항을 명확하게 요약하고 있으며, 간결하고 구체적입니다.
Description check ✅ Passed PR 설명은 관련 이슈, 작업 시간, 작업 내용을 포함하고 있으며, 대부분의 필수 섹션을 충실히 작성했습니다.
Linked Issues check ✅ Passed 모든 링크된 이슈 #1의 요구사항(S3, CloudFront, GitHub Secrets, Branch Protection, format:check, pr-ci.yml, front-deploy.yml)이 충족되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항은 CI/CD 파이프라인 구축이라는 범위 내에 있으며, 불필요한 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/#1-ci-cd-구축

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
.github/workflows/front-deploy.yml (1)

8-10: 배포 동시 실행 방지를 위해 concurrency 추가를 권장합니다.

빠른 연속 머지 시 이전 실행이 늦게 끝나면 최신 산출물을 덮어쓸 수 있습니다. cancel-in-progress로 최신 배포만 유지하세요.

수정 예시
 jobs:
   deploy:
+    concurrency:
+      group: frontend-deploy-main
+      cancel-in-progress: true
     runs-on: ubuntu-latest
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/front-deploy.yml around lines 8 - 10, Add a GitHub Actions
concurrency policy to the deploy job to prevent overlapping deployments: in the
workflow's deploy job (job name "deploy") add a top-level "concurrency" block
with a unique group (e.g., using github.ref or github.workflow combined with the
environment) and "cancel-in-progress: true" so any in-progress deploy is
cancelled when a newer run starts, ensuring only the latest deployment proceeds.
.github/workflows/pr-ci.yml (1)

8-12: 워크플로 토큰 권한을 최소화하는 것이 안전합니다.

현재 권한이 명시되지 않아 저장소 기본 설정에 의존합니다. 이 Job은 쓰기 권한이 필요 없으므로 최소 권한을 명시하는 편이 안전합니다.

수정 예시
 on:
   pull_request:

+permissions:
+  contents: read
+
 jobs:
   check:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-ci.yml around lines 8 - 12, The workflow's check job
currently relies on repository defaults for permissions; update the job named
"check" in .github/workflows/pr-ci.yml to explicitly set minimal permissions
(e.g., add a permissions block such as permissions: contents: read) under the
check job so it does not inherit broader write access from repo defaults.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/front-deploy.yml:
- Around line 13-19: The workflow fails because Yarn 4.13.0 from packageManager
is not enabled before setup-node runs; add a step that runs corepack enable (and
optionally corepack prepare yarn@4.13.0 --activate) before the
actions/setup-node@v4 step so the runner uses Yarn 4.13.0 when executing yarn
install --immutable and yarn build; update the job steps to insert this corepack
command prior to the existing uses: actions/setup-node@v4 and subsequent runs so
cache/version checks succeed.
- Around line 22-27: Replace the static AWS secrets usage in the GitHub Action
step that uses aws-actions/configure-aws-credentials@v4 (currently passing
secrets.AWS_ACCESS_KEY_ID and secrets.AWS_SECRET_ACCESS_KEY) with OIDC-based
role assumption: remove the aws-access-key-id and aws-secret-access-key inputs,
add the role-to-assume input pointing to the IAM role ARN configured for GitHub
OIDC, keep aws-region (secrets.AWS_REGION) as before, and ensure the workflow
uses the aws-actions/configure-aws-credentials action's OIDC flow so the job
obtains temporary credentials from the identity provider instead of long-lived
keys.

In @.github/workflows/pr-ci.yml:
- Around line 16-23: The workflow runs actions/setup-node@v4 before enabling
Corepack which causes CI to fail for packageManager "yarn@4.13.0"; move a step
that runs "corepack enable" to execute before the actions/setup-node@v4 step so
Corepack is active when node is configured and before the "yarn install
--immutable" step runs; ensure the new pre-setup-node step is placed above the
actions/setup-node@v4 entry and clearly precedes the existing "node-version: 22"
and "cache: yarn" configuration.

---

Nitpick comments:
In @.github/workflows/front-deploy.yml:
- Around line 8-10: Add a GitHub Actions concurrency policy to the deploy job to
prevent overlapping deployments: in the workflow's deploy job (job name
"deploy") add a top-level "concurrency" block with a unique group (e.g., using
github.ref or github.workflow combined with the environment) and
"cancel-in-progress: true" so any in-progress deploy is cancelled when a newer
run starts, ensuring only the latest deployment proceeds.

In @.github/workflows/pr-ci.yml:
- Around line 8-12: The workflow's check job currently relies on repository
defaults for permissions; update the job named "check" in
.github/workflows/pr-ci.yml to explicitly set minimal permissions (e.g., add a
permissions block such as permissions: contents: read) under the check job so it
does not inherit broader write access from repo defaults.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a3880394-d84a-4bf9-b56c-833d61b47157

📥 Commits

Reviewing files that changed from the base of the PR and between 1d8fec2 and 2437177.

📒 Files selected for processing (3)
  • .github/workflows/front-deploy.yml
  • .github/workflows/pr-ci.yml
  • package.json

Comment thread .github/workflows/front-deploy.yml
Comment thread .github/workflows/front-deploy.yml
Comment thread .github/workflows/pr-ci.yml
2seb2 added 3 commits April 22, 2026 01:53
- CI 환경의 기본 yarn이 v1이라 yarn berry 실행 불가 문제 수정
- corepack이 package.json의 packageManager 필드를 읽어 yarn@4.13.0으로 자동 전환"
- yarn berry 버전 불일치 오류 수정
- corepack이 먼저 활성화되어야 setup-node의 cache가 올바르게 동작
- .yarn/sdks, .pnp.cjs 등 yarn berry 내부 파일이 lint 대상에 포함되는 문제 수정
@2seb2 2seb2 force-pushed the chore/#1-ci-cd-구축 branch from e0a126e to e02db84 Compare April 21, 2026 17:08
- .yarn, .pnp 파일을 prettier 검사 대상에서 제외
- issue-template.md prettier 포맷 적용
@2seb2 2seb2 merged commit 79a896f into main Apr 21, 2026
2 checks passed
@2seb2 2seb2 deleted the chore/#1-ci-cd-구축 branch April 21, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏗️ Infra 배포, Docker, Redis, CI/CD 설정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chore] CI/CD 파이프라인 구축

1 participant