1
0
mirror of synced 2026-01-04 09:06:46 -05:00
Files
docs/.github/actions/node-npm-setup/action.yml
2024-04-23 16:22:35 +00:00

29 lines
984 B
YAML

name: Node set up composite
description: Will set up Node and install all packages by caching node_modules
runs:
using: 'composite'
steps:
- name: Cache node_modules
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
id: cache-node_modules
env:
# Default is 10 min, per segment, but we can make it much smaller
# because it's not the end of the world if the cache restore fails.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '1'
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}-${{ hashFiles('.github/actions/node-npm-setup/action.yml') }}
- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: 'package.json'
cache: npm
- name: Install dependencies
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
shell: bash
run: npm ci