-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
41 lines (39 loc) · 1.37 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: Setup
description: Setup node and restore dependencies from cache
inputs:
production:
description: Whether to use production dependencies
default: "false"
required: false
ref:
description: The branch, tag or SHA to checkout.
default: ''
required: false
runs:
using: composite
steps:
- uses: actions/checkout@v3.5
with:
ref: ${{ inputs.ref }}
- uses: martijnhols/actions-cache/restore@v3
id: cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ inputs.production }}-${{ hashFiles('**/yarn.lock') }}
- name: Ensure cache hit
shell: bash
if: ${{ steps.cache.outputs.cache-hit != 'true' && env.NODE_AUTH_TOKEN == '' }}
run: |
echo "Could not find cache result for the current workflow."
echo "This means that something went wrong with the 'install-dependencies' step before this job was run."
echo "Please re-run the workflow. If the problem continues send the workflow to the platform team."
exit 1
- name: Use Node.js
uses: actions/setup-node@v3.3.0
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
- name: Install Dependencies
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: yarn --frozen-lockfile --quiet --production=${{ inputs.production }}
shell: bash