diff --git a/.github/actions/cached-deps/action.yml b/.github/actions/cached-deps/action.yml index e9eed16..b6b7c1b 100644 --- a/.github/actions/cached-deps/action.yml +++ b/.github/actions/cached-deps/action.yml @@ -6,6 +6,11 @@ inputs: description: 'Whether to cache dependencies or not.' required: false default: 'true' +# DKDK check steps output +outputs: + used-cached: + description: 'Whether the cache was used' + value: ${{ steps.install.outputs.cache }} runs: # DKDK custom composite action using: 'composite' @@ -18,7 +23,10 @@ runs: path: node_modules key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies + id: install if: steps.cache.outputs.cache-hit != 'true' && inputs.caching != 'true' - run: npm ci + run: | + npm ci + echo "cache='${{ inputs.caching }}" >> $GITHUB_OUTPUT # DKDK shell: bash is required for custom composite action shell: bash \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d591b95..d1a783b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,10 +21,14 @@ jobs: # run: npm ci # DKDK use custom composite action - name: Load & cache dependencies + id: cache-deps # DKDK no need to indicate file (action.yml) uses: ./.github/actions/cached-deps with: caching: 'false' + # DKDK check outputs defined at action.yml + - name: Output information + run: echo "Cache used? $${{ steps.cache-deps.outputs.used-cache }}" - name: Lint code run: npm run lint test: