Skip to content

#55 ci: Vercel 빌드 사전 검증 추가#56

Merged
JiiminHa merged 3 commits intodevelopfrom
ci/vercel-build
Feb 26, 2026
Merged

#55 ci: Vercel 빌드 사전 검증 추가#56
JiiminHa merged 3 commits intodevelopfrom
ci/vercel-build

Conversation

@JiiminHa
Copy link
Contributor

⚙️ Related ISSUE Number

close #55



📄 Work Description

기존 CI에서는 pnpm build만 수행되어
Vercel 환경에서의 빌드 실패 로그를 계정주가 아니라면 확인하기 어려웠습니다.

이를 개선하기 위해 GitHub Actions에 vercel build 단계를 추가하여
Vercel과 동일한 빌드 환경을 CI 단계에서 사전 검증하도록 수정했습니다.

이제 배포 실패 원인을 GitHub Actions 로그에서도 확인할 수 있습니다.



📷 Screenshot

x



💬 To Reviewers

Vercel GitHub Integration은 유지한 상태이며,
CI에서는 빌드 검증만 수행합니다.



🔗 Reference

@JiiminHa JiiminHa requested a review from suminb99 February 26, 2026 01:33
@JiiminHa JiiminHa self-assigned this Feb 26, 2026
@JiiminHa JiiminHa added the ⚙️ setting 개발 환경 세팅 label Feb 26, 2026
@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
snow-code-client Ready Ready Preview, Comment Feb 26, 2026 2:13am

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Summary by CodeRabbit

릴리스 노트

  • 작업
    • CI/CD 파이프라인에 배포 환경을 가져오는 단계와 빌드 시뮬레이션 검증 단계를 추가하여 배포 전 검증을 강화했습니다.
    • 빌드 시 필요한 환경 변수를 전달해 미리 빌드 실패를 확인하고 배포 안정성을 높였습니다.
    • 릴리스 자동화 트리거를 PR 기반에서 푸시 기반으로 변경해 릴리스 생성 조건을 간소화했습니다.

Walkthrough

Build 단계에 Vercel 사전검증을 위한 두 단계가 추가되었습니다: npx vercel pull --environment=preview로 환경을 가져오고 npx vercel build로 Vercel 빌드를 시뮬레이션하며 VERCEL_TOKENVITE_KAKAO_REST_API_KEY, VITE_KAKAO_REDIRECT_URI, VITE_API_BASE_URLVITE_* 환경 변수를 전달합니다. (50 words 이내)

Changes

Cohort / File(s) Summary
CI/CD 파이프라인 개선
/.github/workflows/ci-cd.yml
Build job에 npx vercel pull --environment=previewnpx vercel build 단계 추가. 두 단계에서 VERCEL_TOKEN 사용 및 VITE_KAKAO_REST_API_KEY, VITE_KAKAO_REDIRECT_URI, VITE_API_BASE_URL 환경 변수 전달. 기존 단계 및 에러 처리 변경 없음.
릴리스 드래프터 트리거 축소
/.github/workflows/release-drafter.yml
on: 트리거에서 pull_request 제거하여 푸시 이벤트(예: release/*)만 대상으로 변경. Update Draft Release 조건에서 PR 이벤트 고려 로직 제거.

Sequence Diagram(s)

sequenceDiagram
  participant GH as GitHub Actions Runner
  participant VCLI as Vercel CLI (npx vercel)
  participant VAPI as Vercel API/Platform
  GH->>VCLI: 실행 `npx vercel pull --environment=preview` (VERCEL_TOKEN)
  VCLI->>VAPI: 요청 환경/설정 (토큰 인증)
  VAPI-->>VCLI: 환경 데이터 반환
  VCLI-->>GH: 환경 파일/설정 작성
  GH->>VCLI: 실행 `npx vercel build` (VERCEL_TOKEN + VITE_* envs)
  VCLI->>VAPI: 빌드 시뮬레이션 요청 (토큰 + env)
  VAPI-->>VCLI: 빌드 결과/로그
  VCLI-->>GH: 종료 코드/출력 전달
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • suminb99
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning release-drafter.yml의 변경은 PR 목표와 직접적인 관련이 없으며, 이슈 #55의 요구사항 범위를 벗어나 있습니다. release-drafter.yml의 변경사항(pull_request 트리거 제거)은 별도의 PR로 분리하거나, 이 변경이 필요한 이유를 명확하게 설명해주세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 PR의 주요 변경사항(Vercel 빌드 사전 검증 추가)을 정확하게 반영하고 있습니다.
Description check ✅ Passed 설명에서 CI/CD 워크플로우에 vercel build 단계를 추가하는 변경사항을 명확하게 설명하고 있습니다.
Linked Issues check ✅ Passed CI 파이프라인에 vercel build 단계 추가, VERCEL_TOKEN 설정, 기존 pnpm build 유지 등 이슈 #55의 모든 요구사항을 충족합니다.
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/vercel-build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@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: 1

🧹 Nitpick comments (1)
.github/workflows/ci-cd.yml (1)

53-65: ♻️ DRY 원칙: 환경 변수 중복 제거를 고려해 보세요.

VITE_* 환경 변수가 Build와 Simulate Vercel Build 단계에서 중복됩니다. job 레벨의 env로 통합하면 유지보수가 용이해집니다.

🔧 리팩터링 예시
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    env:
      VITE_KAKAO_REST_API_KEY: ${{ secrets.VITE_KAKAO_REST_API_KEY }}
      VITE_KAKAO_REDIRECT_URI: ${{ secrets.VITE_KAKAO_REDIRECT_URI }}
      VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }}

    steps:
      # ... 기존 steps ...

      - name: Build
        run: pnpm build

      - name: Simulate Vercel Build
        run: npx vercel build
        env:
          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci-cd.yml around lines 53 - 65, The two steps named
"Build" and "Simulate Vercel Build" duplicate the same VITE_* environment
variables; move VITE_KAKAO_REST_API_KEY, VITE_KAKAO_REDIRECT_URI and
VITE_API_BASE_URL into the job-level env block so both steps inherit them, and
remove those three VITE_* entries from the individual "Build" and "Simulate
Vercel Build" step env blocks; keep only step-specific secrets like VERCEL_TOKEN
(and any VERCEL_* IDs) in the "Simulate Vercel Build" step env if needed.
🤖 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/ci-cd.yml:
- Around line 60-65: The Simulate Vercel Build step runs "npx vercel build"
without a linked project, so add project context by either committing the
.vercel/project.json created by running "vercel link" locally (preferred) or by
setting VERCEL_ORG_ID and VERCEL_PROJECT_ID as GitHub Secrets and using them in
the vercel build step; also remove duplicate VITE_* entries in the build step by
defining VITE_KAKAO_REST_API_KEY, VITE_KAKAO_REDIRECT_URI and VITE_API_BASE_URL
at the job-level env so the "Simulate Vercel Build" step simply inherits them.

---

Nitpick comments:
In @.github/workflows/ci-cd.yml:
- Around line 53-65: The two steps named "Build" and "Simulate Vercel Build"
duplicate the same VITE_* environment variables; move VITE_KAKAO_REST_API_KEY,
VITE_KAKAO_REDIRECT_URI and VITE_API_BASE_URL into the job-level env block so
both steps inherit them, and remove those three VITE_* entries from the
individual "Build" and "Simulate Vercel Build" step env blocks; keep only
step-specific secrets like VERCEL_TOKEN (and any VERCEL_* IDs) in the "Simulate
Vercel Build" step env if needed.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b2bc9b and e024658.

📒 Files selected for processing (1)
  • .github/workflows/ci-cd.yml

Copy link

@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.

🧹 Nitpick comments (1)
.github/workflows/release-drafter.yml (1)

27-27: 중복된 조건 검토 제안

현재 워크플로우는 push 이벤트에서만 트리거되므로 github.event_name == 'push' 조건이 항상 true입니다. 가독성을 위해 제거를 고려해볼 수 있습니다.

다만 향후 다른 트리거가 추가될 가능성을 대비한 방어적 코딩으로 볼 수도 있어, 팀 컨벤션에 따라 유지해도 무방합니다.

♻️ 선택적 개선안
      - name: Publish Release
-        if: github.ref == 'refs/heads/main' && github.event_name == 'push'
+        if: github.ref == 'refs/heads/main'
        uses: release-drafter/release-drafter@v6

📚 참고: GitHub Actions 워크플로우 조건문 문서

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-drafter.yml at line 27, The if-condition in the
workflow currently contains a redundant check "if: github.ref ==
'refs/heads/main' && github.event_name == 'push'"; since this workflow is
already triggered only on push events, remove the "&& github.event_name ==
'push'" portion and leave "if: github.ref == 'refs/heads/main'" to improve
readability (or keep as-is if your team prefers defensive verbosity).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/release-drafter.yml:
- Line 27: The if-condition in the workflow currently contains a redundant check
"if: github.ref == 'refs/heads/main' && github.event_name == 'push'"; since this
workflow is already triggered only on push events, remove the "&&
github.event_name == 'push'" portion and leave "if: github.ref ==
'refs/heads/main'" to improve readability (or keep as-is if your team prefers
defensive verbosity).

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc59a1e and b79a118.

📒 Files selected for processing (1)
  • .github/workflows/release-drafter.yml

Copy link
Contributor

@suminb99 suminb99 left a comment

Choose a reason for hiding this comment

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

확인했습니다!

@JiiminHa JiiminHa merged commit da21284 into develop Feb 26, 2026
4 checks passed
@JiiminHa JiiminHa mentioned this pull request Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️ setting 개발 환경 세팅

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: Vercel 빌드 사전 검증 추가

2 participants