feat: add node install action

This commit is contained in:
nafees nazik
2024-01-04 23:41:48 +05:30
parent e470020b16
commit fc372d0aa9

33
.github/actions/node-install/action.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: 'Setup node and cache node_modules'
inputs:
node_version:
required: false
default: v18.x
runs:
using: 'composite'
steps:
- name: Set up Node ${{ inputs.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}
- name: Install dependencies
run: |
npm ci
npm run prisma:generate
env:
HUSKY: '0'