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 2017587
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ 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: |
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,30 @@ 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
- id: install
if: >
steps.restore.outputs.cache-hit != 'true'
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: ${{ steps.restore.outputs.cache-primary-key }}
- name: ✍ Lint
run: npm run lint
Expand Down

0 comments on commit 2017587

Please sign in to comment.