@@ -12,19 +12,23 @@ jobs:
1212 uses : actions/setup-node@v2
1313 with :
1414 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)"
1518 - name : Cache node modules
1619 uses : actions/cache@v2
20+ id : yarn-cache
1721 env :
1822 cache-name : cache-node-modules
1923 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') }}
2326 restore-keys : |
24- ${{ runner.os }}-build -${{ env.cache-name }}-
25- ${{ runner.os }}-build -
27+ ${{ runner.os }}-yarn -${{ env.cache-name }}-
28+ ${{ runner.os }}-yarn -
2629 ${{ runner.os }}-
2730 - name : Install dependencies
31+ # if: ${{ !steps.yarn-cache.outputs.cache-hit }}
2832 env :
2933 CI : true
3034 run : |
@@ -41,19 +45,24 @@ jobs:
4145 - uses : actions/setup-node@v2
4246 with :
4347 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)"
4451 - name : Cache node modules
4552 uses : actions/cache@v2
53+ id : yarn-cache
4654 env :
4755 cache-name : cache-node-modules
4856 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') }}
5259 restore-keys : |
53- ${{ runner.os }}-build -${{ env.cache-name }}-
54- ${{ runner.os }}-build -
60+ ${{ runner.os }}-yarn -${{ env.cache-name }}-
61+ ${{ runner.os }}-yarn -
5562 ${{ runner.os }}-
56- - env :
63+ - name : Install dependencies
64+ # if: ${{ !steps.yarn-cache.outputs.cache-hit }}
65+ env :
5766 CI : true
5867 run : |
5968 yarn install
6271 CI : true
6372 GH_TOKEN : " ${{ secrets.GH_TOKEN }}"
6473 GITHUB_HEAD_REF : $GITHUB_HEAD_REF
65- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
74+ GITHUB_TOKEN : " ${{ secrets.GH_TOKEN }}"
6675 NPM_TOKEN : " ${{ secrets.NPM_TOKEN }}"
6776 run : |
6877 echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > /home/runner/work/_temp/.npmrc
0 commit comments