Skip to content

Commit

Permalink
fix caching
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Mar 12, 2021
1 parent 532206c commit 45e3baa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-check_redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/[email protected]
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@ jobs:
with:
node-version: "12"

- name: Cache node_modules
uses: actions/[email protected]
id: cached-node_modules
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/[email protected]
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: |
{{ github.workspace }}/mdn/content/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-1
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/mdn/content
run: |
yarn --frozen-lockfile
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/sync-translated-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@ jobs:
with:
node-version: "12"

- name: Cache node_modules
uses: actions/[email protected]
id: cached-node_modules
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/[email protected]
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/mdn/content
run: |
yarn --frozen-lockfile
Expand Down

0 comments on commit 45e3baa

Please sign in to comment.