update deploy #184
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
| name: CI | |
| on: | |
| # PR에서 CI 실행 (merge 결과 기준). feature 브랜치는 PR로 검증되고, | |
| # 로컬 lefthook pre-push가 lint/types/test를 1차로 돌려 안전망 역할을 합니다. | |
| pull_request: | |
| # push는 main(머지 커밋)에만 한정합니다. | |
| # 모든 브랜치 push까지 켜면 PR과 이중 실행됩니다 — push 이벤트의 group 키는 | |
| # github.head_ref가 비어 github.ref(refs/heads/<branch>)를 쓰는데, 이는 | |
| # pull_request의 head_ref(<branch>)와 달라 같은 concurrency 그룹으로 합쳐지지 | |
| # 않기 때문입니다. (head_ref와 ref를 한 그룹으로 묶을 방법이 없어 트리거를 분리) | |
| push: | |
| branches: [main] | |
| concurrency: | |
| # 같은 PR 브랜치에 짧은 간격으로 push가 쌓이면 이전 run을 취소(중복 낭비 방지). | |
| # main push는 머지 기록 보호 차원에서 취소하지 않고 완주시킵니다. | |
| group: ci-${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality: | |
| name: Lint / Types / Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 | |
| with: | |
| # 버전은 루트 package.json의 packageManager 필드를 단일 source of truth로 사용 | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| # .tool-versions(nodejs 24.6.0)를 단일 source of truth로 사용 | |
| # node:test --test 의 glob 패턴은 22.5+ 부터 지원 — engines.node ">=22"의 실 근거 | |
| node-version-file: '.tool-versions' | |
| cache: 'pnpm' | |
| cache-dependency-path: '**/pnpm-lock.yaml' | |
| - name: Caching for Turborepo | |
| uses: rharkor/caching-for-turbo@5d14fba18e450c09393333cfd4242e8b3cb455a6 # v2.4.2 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # lint/check-types/test는 모두 turbo 태스크. 한 번의 turbo 호출로 묶으면 | |
| # 공유 의존성(^build)을 한 번만 빌드하고 세 태스크를 의존성 그래프에 맞춰 | |
| # 병렬 실행 + 캐싱합니다. (태스크별로 따로 호출하면 ^build가 중복됩니다) | |
| - name: Lint / Type check / Test | |
| run: pnpm turbo run lint check-types test | |
| # turbo 태스크가 아닌 검사들 (가볍게 끝나므로 순차 실행) | |
| - name: Lint blog posts (frontmatter) | |
| run: pnpm --filter @blog/web lint:posts | |
| - name: Format check | |
| run: pnpm format:check |