FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

cache node_modules the same in all workflows (#3077) · Sudarshan-Reddy-RSE/content@76c5613 · GitHub

Commit 76c5613

Browse files
authored
cache node_modules the same in all workflows (mdn#3077)
1 parent ad98b98 commit 76c5613

2 files changed

Lines changed: 18 additions & 20 deletions

File tree

‎.github/workflows/pr-check_redirects.yml‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,18 @@ jobs:
2020
with:
2121
node-version: "12"
2222

23-
- name: Get yarn cache directory path
24-
id: yarn-cache-dir-path
25-
run: echo "::set-output name=dir::$(yarn cache dir)"
26-
- uses: actions/cache@v2.1.4
27-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
23+
- name: Cache node_modules
24+
uses: actions/cache@v2.1.4
25+
id: cached-node_modules
2826
with:
29-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
30-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
31-
restore-keys: |
32-
${{ runner.os }}-yarn-
27+
path: |
28+
node_modules
29+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
3330

3431
- name: Install all yarn packages
35-
run: yarn --frozen-lockfile
32+
if: steps.cached-node_modules.outputs.cache-hit != 'true'
33+
run: |
34+
yarn --frozen-lockfile
3635
3736
- name: Check redirects file(s)
3837
run: yarn content validate-redirects en-us --strict

‎.github/workflows/preview.yml‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,18 @@ jobs:
1919
with:
2020
node-version: "12"
2121

22-
- name: Get yarn cache directory path
23-
id: yarn-cache-dir-path
24-
run: echo "::set-output name=dir::$(yarn cache dir)"
25-
- uses: actions/cache@v2.1.4
26-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
22+
- name: Cache node_modules
23+
uses: actions/cache@v2.1.4
24+
id: cached-node_modules
2725
with:
28-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
29-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
30-
restore-keys: |
31-
${{ runner.os }}-yarn-
26+
path: |
27+
node_modules
28+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
3229

3330
- name: Install all yarn packages
34-
run: yarn --frozen-lockfile
31+
if: steps.cached-node_modules.outputs.cache-hit != 'true'
32+
run: |
33+
yarn --frozen-lockfile
3534
3635
- name: Start the Yari server
3736
run: |

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL