Skip to content

Commit

Permalink
Cache build node_modules from within build dir
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-va committed Apr 17, 2024
1 parent 0f833a5 commit 5c806f1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
path: ./node_modules
key: "${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ runner.os }}-npm-
Expand All @@ -42,10 +42,8 @@ jobs:
- name: Restore cached node modules
uses: actions/cache@v2
with:
path: ~/.npm
path: ./node_modules
key: "${{ runner.os }}-npm-${{ steps.cache-node-modules.outputs.cache-key }}"
- name: Install node dependencies
run: npm ci
- name: Run tests
run: npm run test

Expand All @@ -62,10 +60,8 @@ jobs:
- name: Restore cached node modules
uses: actions/cache@v2
with:
path: ~/.npm
path: ./node_modules
key: "${{ runner.os }}-npm-${{ steps.cache-node-modules.outputs.cache-key }}"
- name: Install node dependencies
run: npm ci
- name: Run lint
run: npm run lint

Expand All @@ -90,7 +86,7 @@ jobs:
- name: Restore cached node modules
uses: actions/cache@v2
with:
path: ~/.npm
path: ./node_modules
key: "${{ runner.os }}-npm-${{ steps.cache-node-modules.outputs.cache-key }}"
- name: Run build
run: npm run build
Expand Down

0 comments on commit 5c806f1

Please sign in to comment.