From 8f19d43632c55c14d86c76b0eb856e61d3e0bf98 Mon Sep 17 00:00:00 2001 From: Derek Slenk Date: Wed, 16 Jul 2025 14:28:39 -0400 Subject: [PATCH] Add Next.js build caching to CI/CD workflows --- .forgejo/workflows/ci.yml | 10 ++++++++++ .forgejo/workflows/deploy.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 846b4e1..5d54503 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -13,6 +13,16 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Cache Next.js build + uses: actions/cache@v3 + with: + path: | + ~/.npm + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- + - name: Install dependencies run: npm ci diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 20f0d10..937d4f3 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -12,6 +12,16 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Cache Next.js build + uses: actions/cache@v3 + with: + path: | + ~/.npm + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- + - name: Install dependencies run: npm ci