Skip to content

CI 빌드 캐시 도입 #91

Description

@hyoseong1994

현재 integration.yml, deploy.yml에는 캐시가 전혀 없어 매 실행마다 의존성 설치·브라우저 다운로드·Vite 번들을 처음부터 반복하고 있습니다.
콘텐츠/다이어그램/컴포넌트가 늘어날수록 CI 시간이 선형으로 증가하므로, 프레임워크 변경 없이 actions/cache로 미리 대비합니다.

▎ 관련: #89 (Astro 마이그레이션 검토), #90 (loader cache 논의)
▎ OG 이미지 캐시(public/og)는 preview.yml에 이미 적용되어 있어 이 이슈 범위에서 제외합니다.

의존성 캐시

bun install 결과를 캐시합니다. key가 bun.lock 해시라 lockfile이 바뀔 때만 무효화되어 정합성 문제가 없습니다. 세 워크플로우 어디에도 없는, 가장
기본이자 효과가 큰 캐시입니다.

  • uses: oven-sh/setup-bun@v2
  • uses: actions/cache@v4
    with:
    path: ~/.bun/install/cache
    key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
    restore-keys: bun-${{ runner.os }}-

Playwright 브라우저 캐시

rehype-mermaid가 다이어그램 렌더에 사용하는 헤드리스 브라우저 다운로드를 재사용합니다. 다이어그램을 포함한 글이 늘어나면 이 다운로드 비용이
커집니다.

  • uses: actions/cache@v4
    with:
    path: ~/.cache/ms-playwright
    key: playwright-${{ runner.os }}-${{ hashFiles('bun.lock') }}

Vite 빌드 캐시

node_modules/.vite의 사전 번들(pre-bundle) 결과를 재사용합니다. RR7 스택에서 Astro loader cache에 개념적으로 가장 가까운 계층으로, 의존성이나 빌드
설정이 그대로면 재번들을 건너뜁니다.

  • uses: actions/cache@v4
    with:
    path: node_modules/.vite
    key: vite-${{ runner.os }}-${{ hashFiles('bun.lock', 'vite.config.ts') }}
    restore-keys: vite-${{ runner.os }}-

적용 대상

  • 대상: integration.yml, deploy.yml

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions