29 lines
820 B
YAML
29 lines
820 B
YAML
name: Setup
|
|
description: Setup Node Env
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
# - name: Get npm cache directory
|
|
# run: node -p -e '`NPM_CACHE_DIR=${require("child_process").execSync("npm config get cache").toString()}`' >> $GITHUB_ENV
|
|
# run: echo "NPM_CACHE_DIR=$(npm config get cache)" >> $GITHUB_ENV
|
|
|
|
# https://docs.npmjs.com/cli/v10/configuring-npm/folders#cache
|
|
- name: Cache node modules
|
|
id: cache-npm
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.NPM_CACHE }}
|
|
key: ${{ runner.os }}-npm-cache-${{ hashFiles('package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-npm-cache-
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
shell: bash
|