/
action.yml
41 lines (39 loc) · 1.25 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Install Dependencies
description: |
Install dependencies for the project.
inputs:
npm-token:
description: "NPM token"
default: ""
required: false
production:
description: Whether to install production dependencies
default: "false"
required: false
runs:
using: composite
steps:
- uses: actions/checkout@v3.5
- id: check-cache
uses: martijnhols/actions-cache/check@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ inputs.production }}-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js
uses: actions/setup-node@v3.3.0
if: steps.check-cache.outputs.cache-hit != 'true'
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
- name: Install Dependencies
if: steps.check-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile --quiet --production=${{ inputs.production }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ inputs.npm-token == '' && env.NODE_AUTH_TOKEN || inputs.npm-token }}
- uses: martijnhols/actions-cache/save@v3
id: cache
if: steps.check-cache.outputs.cache-hit != 'true'
with:
path: node_modules
key: ${{ steps.check-cache.outputs.primary-key }}