diff --git a/.changeset/release-1780351813.md b/.changeset/release-1780351813.md new file mode 100644 index 0000000..49086f3 --- /dev/null +++ b/.changeset/release-1780351813.md @@ -0,0 +1,5 @@ +--- +"portfolio": patch +--- + +- ci(cache): correct and optimize nextjs build caching diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93d2221..746fd6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,9 +98,14 @@ jobs: - uses: actions/setup-node@v4 with: { node-version: 22, cache: pnpm } - run: pnpm install --frozen-lockfile - - run: pnpm build - - uses: actions/cache@v4 + - name: Cache Next.js build + uses: actions/cache@v4 with: - path: "**/dist" - key: build-${{ github.sha }} + path: | + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- + - run: pnpm build +