-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
28 lines (28 loc) · 807 Bytes
/
action.yml
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
27
28
name: 'Get & Cache Dependencies'
description: 'Get the dependencies (via npm) and cache them.'
inputs:
caching:
description: 'Weather to cache dependencies or not.'
required: false
default: 'true'
outputs:
used-cache:
description: 'Cache was used.'
value: ${{ steps.install.outputs.cache }}
runs:
using: 'composite'
steps:
- name: Cache dependencies
if: inputs.caching == 'true'
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
id: install
if: steps.cache.outputs.cache-hit != 'true' || inputs.caching != 'true'
run: |
npm ci
echo "cache=${{ inputs.caching }}" >> $GITHUB_OUTPUT
shell: bash