Skip to content

Commit 04e219d

Browse files
committed
add action cache
1 parent 9079356 commit 04e219d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: .github/workflows/deploy-demo.yml

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ jobs:
1515
with:
1616
node-version: '12'
1717

18+
# see https://github.com/actions/cache/blob/main/examples.md#node---yarn
19+
- name: Get yarn cache directory path
20+
id: yarn-cache-dir-path
21+
run: echo "::set-output name=dir::$(yarn cache dir)"
22+
23+
- name: Cache
24+
uses: actions/cache@v2
25+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
26+
with:
27+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
31+
1832
- name: Install
1933
run: yarn install
2034

0 commit comments

Comments
 (0)