@@ -12,19 +12,23 @@ jobs:
12
12
uses : actions/setup-node@v2
13
13
with :
14
14
node-version : 12
15
+ - id : yarn-cache-dir
16
+ name : Find Yarn's cache folder
17
+ run : echo "::set-output name=path::$(yarn config get cacheFolder)"
15
18
- name : Cache node modules
16
19
uses : actions/cache@v2
20
+ id : yarn-cache
17
21
env :
18
22
cache-name : cache-node-modules
19
23
with :
20
- # npm cache files are stored in `~/.npm` on Linux/macOS
21
- path : ~/.npm
22
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
24
+ path : ${{ steps.yarn-cache-dir.outputs.path }}
25
+ key : ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
23
26
restore-keys : |
24
- ${{ runner.os }}-build -${{ env.cache-name }}-
25
- ${{ runner.os }}-build -
27
+ ${{ runner.os }}-yarn -${{ env.cache-name }}-
28
+ ${{ runner.os }}-yarn -
26
29
${{ runner.os }}-
27
30
- name : Install dependencies
31
+ # if: ${{ !steps.yarn-cache.outputs.cache-hit }}
28
32
env :
29
33
CI : true
30
34
run : |
@@ -41,19 +45,24 @@ jobs:
41
45
- uses : actions/setup-node@v2
42
46
with :
43
47
node-version : 12
48
+ - id : yarn-cache-dir
49
+ name : Find Yarn's cache folder
50
+ run : echo "::set-output name=path::$(yarn config get cacheFolder)"
44
51
- name : Cache node modules
45
52
uses : actions/cache@v2
53
+ id : yarn-cache
46
54
env :
47
55
cache-name : cache-node-modules
48
56
with :
49
- # npm cache files are stored in `~/.npm` on Linux/macOS
50
- path : ~/.npm
51
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
57
+ path : ${{ steps.yarn-cache-dir.outputs.path }}
58
+ key : ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
52
59
restore-keys : |
53
- ${{ runner.os }}-build -${{ env.cache-name }}-
54
- ${{ runner.os }}-build -
60
+ ${{ runner.os }}-yarn -${{ env.cache-name }}-
61
+ ${{ runner.os }}-yarn -
55
62
${{ runner.os }}-
56
- - env :
63
+ - name : Install dependencies
64
+ # if: ${{ !steps.yarn-cache.outputs.cache-hit }}
65
+ env :
57
66
CI : true
58
67
run : |
59
68
yarn install
62
71
CI : true
63
72
GH_TOKEN : " ${{ secrets.GH_TOKEN }}"
64
73
GITHUB_HEAD_REF : $GITHUB_HEAD_REF
65
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
74
+ GITHUB_TOKEN : " ${{ secrets.GH_TOKEN }}"
66
75
NPM_TOKEN : " ${{ secrets.NPM_TOKEN }}"
67
76
run : |
68
77
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > /home/runner/work/_temp/.npmrc
0 commit comments