Skip to content

Commit 7255bca

Browse files
chenxsansnitin315
andauthored
upgrade actions/setup-node@v2 (#5230)
* use built-in cache * use built-in cache * Update .github/workflows/testing.yml Co-authored-by: Nitin Kumar <[email protected]> * use setup-node@v2 Co-authored-by: Nitin Kumar <[email protected]>
1 parent bbccc47 commit 7255bca

File tree

2 files changed

+6
-67
lines changed

2 files changed

+6
-67
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,10 @@ jobs:
1818
- uses: actions/checkout@v2
1919

2020
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v1
21+
uses: actions/setup-node@v2
2222
with:
2323
node-version: ${{ matrix.node-version }}
24-
25-
- name: Get yarn cache directory path
26-
id: yarn-cache-dir-path
27-
run: echo "::set-output name=dir::$(yarn cache dir)"
28-
29-
- uses: actions/cache@v2
30-
id: yarn-cache
31-
with:
32-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
33-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34-
restore-keys: |
35-
${{ runner.os }}-yarn-
24+
cache: yarn
3625

3726
- run: yarn --frozen-lockfile
3827
- name: Build site
@@ -47,4 +36,3 @@ jobs:
4736
BRANCH: gh-pages
4837
FOLDER: dist
4938
CLEAN: true
50-

.github/workflows/testing.yml

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,7 @@ jobs:
2121
uses: actions/setup-node@v2
2222
with:
2323
node-version: ${{ matrix.node-version }}
24-
25-
- name: Get yarn cache directory path
26-
id: yarn-cache-dir-path
27-
run: echo "::set-output name=dir::$(yarn cache dir)"
28-
29-
- uses: actions/cache@v2
30-
id: yarn-cache
31-
with:
32-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
33-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34-
restore-keys: |
35-
${{ runner.os }}-yarn-
24+
cache: yarn
3625

3726
- run: yarn --frozen-lockfile
3827
- run: yarn lint:js
@@ -68,29 +57,10 @@ jobs:
6857
uses: actions/setup-node@v2
6958
with:
7059
node-version: ${{ matrix.node-version }}
71-
72-
- name: Get yarn cache directory path
73-
id: yarn-cache-dir-path
74-
run: echo "::set-output name=dir::$(yarn cache dir)"
75-
76-
- uses: actions/cache@v2
77-
id: yarn-cache
78-
with:
79-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
80-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
81-
restore-keys: |
82-
${{ runner.os }}-yarn-
60+
cache: yarn
8361

8462
- run: yarn
8563

86-
- uses: actions/cache@v2
87-
id: build-cache
88-
with:
89-
path: .cache
90-
key: build-${{ hashFiles('webpack.*.js') }}-${{ hashFiles('**/yarn.lock') }}
91-
restore-keys: |
92-
build-${{ hashFiles('webpack.*.js') }}-
93-
9464
- name: Build site
9565
run: yarn build
9666
env:
@@ -108,29 +78,10 @@ jobs:
10878
- uses: actions/checkout@v2
10979

11080
- name: Use Node.js ${{ matrix.node-version }}
111-
uses: actions/setup-node@v1
81+
uses: actions/setup-node@v2
11282
with:
11383
node-version: ${{ matrix.node-version }}
114-
115-
- name: Get yarn cache directory path
116-
id: yarn-cache-dir-path
117-
run: echo "::set-output name=dir::$(yarn cache dir)"
118-
119-
- uses: actions/cache@v2
120-
id: yarn-cache
121-
with:
122-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
123-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
124-
restore-keys: |
125-
${{ runner.os }}-yarn-
126-
127-
- uses: actions/cache@v2
128-
id: build-cache
129-
with:
130-
path: .cache
131-
key: build-e2e-${{ hashFiles('webpack.*.js') }}-${{ hashFiles('**/yarn.lock') }}
132-
restore-keys: |
133-
build-e2e-${{ hashFiles('webpack.*.js') }}-
84+
cache: yarn
13485

13586
- run: |
13687
yarn

0 commit comments

Comments
 (0)