Skip to content

Commit

Permalink
Cache node_modules
Browse files Browse the repository at this point in the history
Don't cache the yarn cache, since we need to build fresh packages even
when we copy files from the yarn cache into node_modules.
  • Loading branch information
ptgott committed Oct 29, 2024
1 parent 9ddd54c commit 3f2a00e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/doc-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,10 @@ jobs:
repository: "gravitational/docs"
path: "docs"

# Set up caching for node_modules across workflow runs.
# The following two steps are based on this example:
# https://github.com/actions/cache/blob/6849a6489940f00c2f30c0fb92c6274307ccb58a/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
path: '${{ github.workspace }}/docs/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}/docs/yarn.lock', github.workspace)) }}
restore-keys: |
${{ runner.os }}-yarn-
Expand Down

0 comments on commit 3f2a00e

Please sign in to comment.