From 63853ffa8920d52b4d5cee60b0317f89cc9cb968 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Mon, 23 Feb 2026 02:17:31 +0100 Subject: [PATCH] chore(ci): Optimize Turborepo cache restoring and add Next.js BuildKit caching --- .gitea/workflows/ci.yml | 7 +++++-- .gitea/workflows/deploy.yml | 9 +++++++-- Dockerfile | 3 ++- package.json | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 90db18e1..caa8926d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -50,12 +50,15 @@ jobs: uses: actions/cache@v4 with: path: .turbo - key: ${{ runner.os }}-turbo-${{ github.sha }} + key: ${{ runner.os }}-turbo-${{ github.ref_name }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-turbo-${{ github.ref_name }}- ${{ runner.os }}-turbo- - name: ๐Ÿงช QA Checks - run: npx turbo run check:mdx lint typecheck test + env: + TURBO_TELEMETRY_DISABLED: 1 + run: npx turbo run check:mdx lint typecheck test --cache-dir=".turbo" - name: ๐Ÿ—๏ธ Build run: pnpm build diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 936e27c6..bae2bb3f 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -175,15 +175,18 @@ jobs: uses: actions/cache@v4 with: path: .turbo - key: ${{ runner.os }}-turbo-${{ github.sha }} + key: ${{ runner.os }}-turbo-${{ github.ref_name }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-turbo-${{ github.ref_name }}- ${{ runner.os }}-turbo- - name: ๐Ÿ”’ Security Audit run: pnpm audit --audit-level high - name: ๐Ÿงช QA Checks if: github.event.inputs.skip_checks != 'true' - run: npx turbo run lint check:spell typecheck test + env: + TURBO_TELEMETRY_DISABLED: 1 + run: npx turbo run lint check:spell typecheck test --cache-dir=".turbo" # โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ # JOB 3: Build & Push @@ -209,6 +212,8 @@ jobs: push: true provenance: false platforms: linux/arm64 + cache-from: type=gha,scope=nextjs-build-${{ needs.prepare.outputs.target }} + cache-to: type=gha,mode=max,scope=nextjs-build-${{ needs.prepare.outputs.target }} build-args: | NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_url }} NEXT_PUBLIC_TARGET=${{ needs.prepare.outputs.target }} diff --git a/Dockerfile b/Dockerfile index f0363222..2dd8349f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,8 @@ CMD ["pnpm", "dev:local"] # Build application # Stage 3: Builder (Production) FROM base AS builder -RUN pnpm build +RUN --mount=type=cache,target=/app/.next/cache,id=nextjs-cache \ + pnpm build # Stage 3: Runner FROM registry.infra.mintel.me/mintel/runtime:v1.7.10 AS runner diff --git a/package.json b/package.json index 374bdb32..31d59fb8 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "prepare": "husky", "preinstall": "npx only-allow pnpm" }, - "version": "1.0.0", + "version": "1.0.1-rc.0", "pnpm": { "overrides": { "next": "16.1.6",