Skip to content

Commit

Permalink
chore: change to cache node_modules directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ganta committed Dec 30, 2023
1 parent be961cc commit 49d73f4
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
pull_request:

env:
NODE_MODULES_CACHE_KEY: node-modules-${{ runner.os }}-${{ hashFiles('.node-version') }}-${{ hashFiles('package-lock.json') }}

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -16,8 +19,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ env.NODE_MODULES_CACHE_KEY }}
restore-keys: ${{ env.NODE_MODULES_CACHE_KEY }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Run lint
run: npm run lint
Expand All @@ -31,8 +41,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ env.NODE_MODULES_CACHE_KEY }}
restore-keys: ${{ env.NODE_MODULES_CACHE_KEY }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Package extension
run: npm run package
Expand All @@ -46,8 +63,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ env.NODE_MODULES_CACHE_KEY }}
restore-keys: ${{ env.NODE_MODULES_CACHE_KEY }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Build Storybook
run: npm run build-storybook

0 comments on commit 49d73f4

Please sign in to comment.