-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathaction.yml
More file actions
26 lines (26 loc) · 937 Bytes
/
action.yml
File metadata and controls
26 lines (26 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: 'Setup Node and node_modules cache'
description: 'Setup Node.js and node_modules'
inputs:
node-version:
description: 'Node.js version'
required: true
outputs:
cache-hit:
description: 'Whether node_modules cache was hit'
value: ${{ steps.node-modules-cache.outputs.cache-hit }}
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v4
id: setup-node
with:
node-version: ${{ inputs.node-version }}
- uses: actions/cache@v4
id: node-modules-cache
with:
path: node_modules
key: node-modules-${{ runner.arch }}-${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-modules-${{ runner.arch }}-${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-npm-
- run: npm install
if: steps.node-modules-cache.outputs.cache-hit != 'true'
shell: sh