From a39fae6165ab634ab703fba5add48ac83a3e3f8c Mon Sep 17 00:00:00 2001 From: Lauro Fialho Mueller Date: Sat, 11 Nov 2023 18:03:12 +0100 Subject: [PATCH] feat(13-caching): add caching for dependencies --- .github/workflows/13-caching.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/13-caching.yaml b/.github/workflows/13-caching.yaml index b05ca5a..a7e1415 100644 --- a/.github/workflows/13-caching.yaml +++ b/.github/workflows/13-caching.yaml @@ -29,7 +29,15 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ inputs.node-version }} + - name: Download cached dependencies + uses: actions/cache@v3 + if: ${{ inputs.use-cache }} + id: cache + with: + path: 13-caching/react-app/node_modules + key: deps-node-modules-${{ hashFiles('13-caching/react-app/package-lock.json') }} - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' run: npm ci - name: Testing run: npm run test