Skip to content

Commit

Permalink
Update refresh-cache.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezyLemon authored Oct 9, 2023
1 parent e6fd258 commit bf9e1db
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/refresh-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@ jobs:
with:
sparse-checkout: '.'

- name: set up Node.js
id: setup-node
uses: actions/setup-node@v3
with:
cache: npm
node-version: 16

- name: check node_modules cache
id: cache-node-modules
uses: actions/cache/restore@v3
with:
path: node_modules
lookup-only: true
key: node-modules-${{ hashFiles('package.json', 'package-lock.json') }}-${{ steps.setup-node.outputs.node-version }}
key: node-modules-${{ hashFiles('package-lock.json') }}-${{ steps.setup-node.outputs.node-version }}

- name: 'if cache outdated: install node_modules'
if: steps.cache-node-modules.outputs.cache-hit != 'true'
Expand All @@ -31,4 +38,4 @@ jobs:
uses: actions/cache/save@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package.json', 'package-lock.json') }}-${{ steps.setup-node.outputs.node-version }}
key: node-modules-${{ hashFiles('package-lock.json') }}-${{ steps.setup-node.outputs.node-version }}

0 comments on commit bf9e1db

Please sign in to comment.