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