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 24c565e commit f7d863b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/refresh-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: '' # top-level dir included by default
sparse-checkout: '.'

- name: check node_modules cache
id: cache-node-modules
uses: actions/cache@v3
uses: actions/cache/restore@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package.json', 'package-lock.json') }}-${{ steps.setup-node.outputs.node-version }}
lookup-only: true
key: node-modules-${{ hashFiles('package.json', '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'
run: npm ci

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

0 comments on commit f7d863b

Please sign in to comment.