Skip to content

Commit

Permalink
always save cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ph-fritsche committed Feb 4, 2025
1 parent 50096e3 commit 3d9e0a6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ jobs:
sparse-checkout-cone-mode: false
sparse-checkout: |
package.json
- name: 📥 Install deps
- id: install
name: 📥 Install deps
run: yarn
env:
HUSKY_SKIP_INSTALL: true
- name: ♻️ Save node_modules
- if: >
always() && steps.install.outcome == 'success'
name: ♻️ Save node_modules
uses: actions/cache/save@v4
with:
path: |
yarn.lock
node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json') }}
key: ${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
23 changes: 19 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,32 @@ jobs:
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ♻️ Cache node_modules
uses: actions/cache@v4
- id: restore
name: ♻️ Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
yarn.lock
node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json') }}
- name: 📥 Install deps
key: ${{ hashFiles('package.json') }}
restore-keys: ${{ hashFiles('package.json') }}-

- id: install
if: >
steps.restore.outputs.cache-matched-key == ''
name: 📥 Install deps
run: yarn
env:
HUSKY_SKIP_INSTALL: true
- if: >
steps.install.outcome == 'success'
name: ♻️ Save node_modules
uses: actions/cache/save@v4
with:
path: |
yarn.lock
node_modules
key: ${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
- name: ✍ Lint
run: npm run lint
Expand Down

0 comments on commit 3d9e0a6

Please sign in to comment.