Skip to content

Commit

Permalink
refactor: to add node from cache
Browse files Browse the repository at this point in the history
  • Loading branch information
yaswanth-deriv committed Oct 24, 2023
1 parent 2258faa commit 3b1034f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
9 changes: 0 additions & 9 deletions .github/actions/npm_install/action.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/actions/npm_install_from_cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: npm_install_from_cache
description: Install npm packages from cache
runs:
using: composite
steps:
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache/restore@v3
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('./package-lock.json') }}
- name: Install npm dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: |-
npm ci
npm run format
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install npm packages
uses: "./.github/actions/npm_install"
uses: "./.github/actions/npm_install_from_cache"
- name: Build
uses: "./.github/actions/build"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Tag
uses: "./.github/actions/tag"
- name: Install npm packages
uses: "./.github/actions/npm_install"
uses: "./.github/actions/npm_install_from_cache"
- name: Build
uses: "./.github/actions/build"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install npm packages
uses: "./.github/actions/npm_install"
uses: "./.github/actions/npm_install_from_cache"
- name: Build
uses: "./.github/actions/build"

0 comments on commit 3b1034f

Please sign in to comment.