1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-11-23 20:19:16 +01:00

Merge pull request #434 from DanielHabenicht/patch-1

Update examples.md for NPM
This commit is contained in:
Konrad Pabjan 2021-01-14 17:22:53 +01:00 committed by GitHub
commit 354332455a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,12 +195,13 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
```yaml ```yaml
- name: Get npm cache directory - name: Get npm cache directory
id: npm-cache id: npm-cache-dir
run: | run: |
echo "::set-output name=dir::$(npm config get cache)" echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2 - uses: actions/cache@v2
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with: with:
path: ${{ steps.npm-cache.outputs.dir }} path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-