Skip to content

Commit d73df3b

Browse files
authored
ci(pipeline): refactor cache (#40)
1 parent 4d423f3 commit d73df3b

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/pipeline-release.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,28 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
strategy:
20-
matrix:
21-
node-version: ['14.x']
20+
fail-fast: false
2221

2322
steps:
24-
- uses: actions/checkout@v2
25-
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v2
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-node@v3
2725
with:
28-
node-version: ${{ matrix.node-version }}
29-
fetch-depth: 0
26+
node-version: "16"
3027

31-
- uses: actions/cache@v2
32-
with:
33-
path: '**/node_modules'
34-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
28+
- name: Get yarn cache directory path
29+
id: yarn-cache-dir-path
30+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
3531

36-
- name: webpage install, build, and test
37-
uses: actions/setup-node@v2
32+
- name: ⚡ Cache yarn dependencies
33+
uses: actions/cache@v3
34+
id: yarn-cache
35+
with:
36+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
37+
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock') }}
38+
restore-keys: |
39+
yarn-cache-folder-
3840
3941
- run: yarn install --prefer-offline
40-
if: steps.yarn-cache.outputs.cache-hit != 'true'
4142
id: install
4243

4344
- run: npm i -g lerna

0 commit comments

Comments
 (0)