From 136965676576fa5e6a73ba5a68a07d832691e142 Mon Sep 17 00:00:00 2001 From: Alexander Bigga Date: Wed, 26 Feb 2025 19:45:00 +0100 Subject: [PATCH] Speedup GitHub workflow (#816) --- .github/workflows/build-deploy.yml | 10 ++++++++++ .github/workflows/build-test.yml | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 73ecf3c9..41dab513 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -27,7 +27,17 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} + - name: Cache node_modules directory + uses: actions/cache@v4 + id: npm-cache-dir + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install npm packages + if: steps.npm-cache-dir.outputs.cache-hit != 'true' run: npm ci - name: Build CSS diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e0c8c2e4..f3e10921 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -31,15 +31,17 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - - name: Cache .npm directory + - name: Cache node_modules directory uses: actions/cache@v4 + id: npm-cache-dir with: - path: ~/.npm + path: node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Install npm packages + if: steps.npm-cache-dir.outputs.cache-hit != 'true' run: npm ci - name: Lint SCSS