fix: use cache key based on run_id and run_attempt

This commit is contained in:
Derrick Hammer 2023-06-25 01:35:00 -04:00
parent 967c194a45
commit c5eaa34e39
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 4 deletions

View File

@ -6,8 +6,6 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
cache-primary-key: ${{ steps.cache.outputs.cache-primary-key }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Use Node.js - name: Use Node.js
@ -23,7 +21,7 @@ jobs:
with: with:
# npm cache files are stored in `~/.npm` on Linux/macOS # npm cache files are stored in `~/.npm` on Linux/macOS
path: ./ path: ./
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json','lib/**') }} key: cache-${{ github.run_id }}-${{ github.run_attempt }}
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
@ -31,7 +29,7 @@ jobs:
- uses: actions/cache/restore@v3 - uses: actions/cache/restore@v3
with: with:
path: . path: .
key: ${{ needs.build.outputs.cache-primary-key }} key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Install SSH key - name: Install SSH key
uses: shimataro/ssh-key-action@v2 uses: shimataro/ssh-key-action@v2
with: with: