perf(ui): optimize CI cache for pnpm and Next.js builds (#9843)

This commit is contained in:
Alan Buscaglia
2026-01-21 13:18:31 +01:00
committed by GitHub
parent 9c76dafaa4
commit 607cfd61ef
2 changed files with 18 additions and 10 deletions

View File

@@ -125,16 +125,20 @@ jobs:
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache - name: Setup pnpm and Next.js cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with: with:
path: ${{ env.STORE_PATH }} path: |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ui/pnpm-lock.yaml') }} ${{ env.STORE_PATH }}
./ui/node_modules
./ui/.next/cache
key: ${{ runner.os }}-pnpm-nextjs-${{ hashFiles('ui/pnpm-lock.yaml') }}-${{ hashFiles('ui/**/*.ts', 'ui/**/*.tsx', 'ui/**/*.js', 'ui/**/*.jsx') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pnpm-store- ${{ runner.os }}-pnpm-nextjs-${{ hashFiles('ui/pnpm-lock.yaml') }}-
${{ runner.os }}-pnpm-nextjs-
- name: Install UI dependencies - name: Install UI dependencies
working-directory: ./ui working-directory: ./ui
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile --prefer-offline
- name: Build UI application - name: Build UI application
working-directory: ./ui working-directory: ./ui
run: pnpm run build run: pnpm run build

View File

@@ -62,18 +62,22 @@ jobs:
shell: bash shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache - name: Setup pnpm and Next.js cache
if: steps.check-changes.outputs.any_changed == 'true' if: steps.check-changes.outputs.any_changed == 'true'
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with: with:
path: ${{ env.STORE_PATH }} path: |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ui/pnpm-lock.yaml') }} ${{ env.STORE_PATH }}
${{ env.UI_WORKING_DIR }}/node_modules
${{ env.UI_WORKING_DIR }}/.next/cache
key: ${{ runner.os }}-pnpm-nextjs-${{ hashFiles('ui/pnpm-lock.yaml') }}-${{ hashFiles('ui/**/*.ts', 'ui/**/*.tsx', 'ui/**/*.js', 'ui/**/*.jsx') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pnpm-store- ${{ runner.os }}-pnpm-nextjs-${{ hashFiles('ui/pnpm-lock.yaml') }}-
${{ runner.os }}-pnpm-nextjs-
- name: Install dependencies - name: Install dependencies
if: steps.check-changes.outputs.any_changed == 'true' if: steps.check-changes.outputs.any_changed == 'true'
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile --prefer-offline
- name: Run healthcheck - name: Run healthcheck
if: steps.check-changes.outputs.any_changed == 'true' if: steps.check-changes.outputs.any_changed == 'true'