File tree 2 files changed +25
-7
lines changed
2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,17 @@ jobs:
22
22
sparse-checkout-cone-mode : false
23
23
sparse-checkout : |
24
24
package.json
25
- - name : 📥 Install deps
25
+ - id : install
26
+ name : 📥 Install deps
26
27
run : yarn
27
28
env :
28
29
HUSKY_SKIP_INSTALL : true
29
- - name : ♻️ Save node_modules
30
+ - if : >
31
+ steps.install.outcome == 'success'
32
+ name: ♻️ Save node_modules
30
33
uses: actions/cache/save@v4
31
34
with:
32
35
path: |
33
36
yarn.lock
34
37
node_modules
35
- key : ${{ runner.os }}-${{ hashFiles('package.json ') }}
38
+ key: ${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock ') }}
Original file line number Diff line number Diff line change @@ -14,17 +14,32 @@ jobs:
14
14
steps :
15
15
- name : ⬇️ Checkout repo
16
16
uses : actions/checkout@v4
17
- - name : ♻️ Cache node_modules
18
- uses : actions/cache@v4
17
+ - id : restore
18
+ name : ♻️ Restore node_modules
19
+ uses : actions/cache/restore@v4
19
20
with :
20
21
path : |
21
22
yarn.lock
22
23
node_modules
23
- key : ${{ runner.os }}-${{ hashFiles('package.json') }}
24
- - name : 📥 Install deps
24
+ key : ${{ hashFiles('package.json') }}
25
+ restore-keys : ${{ hashFiles('package.json') }}-
26
+
27
+ - id : install
28
+ if : >
29
+ steps.restore.outputs.cache-matched-key == ''
30
+ name : 📥 Install deps
25
31
run : yarn
26
32
env :
27
33
HUSKY_SKIP_INSTALL : true
34
+ - if : >
35
+ steps.install.outcome == 'success'
36
+ name: ♻️ Save node_modules
37
+ uses: actions/cache/save@v4
38
+ with:
39
+ path: |
40
+ yarn.lock
41
+ node_modules
42
+ key: ${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
28
43
29
44
- name : ✍ Lint
30
45
run : npm run lint
You can’t perform that action at this time.
0 commit comments