-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
71 lines (58 loc) · 1.95 KB
/
action.yaml
File metadata and controls
71 lines (58 loc) · 1.95 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Prepare environment for NodeJS PNPM
author: 'MiLaboratories'
description: |
Prepare environment: install specific version of Node, restore cache for modules.
inputs:
node-version:
description: |
Node version to use.
Examples: '16.x', '14.x'
required: true
cache-version:
description: |
Simple hack, that allows to 'reset' cache for particular job.
Just change the value of this parameter and the next run will
not find build cache and will have to start from scratch.
required: false
default: 'v1'
cache-hashfiles-search-path:
description: |
Hashfiles search path for pnpm-lock.yaml
required: false
default: '**/pnpm-lock.yaml'
pnpm-version:
description: |
Version of pnpm to install.
Leave empty to use version from packageManager field in package.json.
required: false
default: ''
npmrc-config:
description: |
Generates a .npmrc file based on provided configuration.
required: false
runs:
using: "composite"
steps:
- name: Install NodeJS - ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Re-Write .npmrc config
uses: milaboratory/github-ci/actions/utils/create-npmrc@v4
if: inputs.npmrc-config != ''
with:
npmrcConfig: ${{ inputs.npmrc-config }}
- name: Install pnpm - ${{ inputs.pnpm-version }}
if: inputs.pnpm-version != ''
uses: pnpm/action-setup@v4
with:
version: ${{ inputs.pnpm-version }}
- name: Install pnpm from packageManager field in package.json
if: inputs.pnpm-version == ''
shell: bash
run: corepack enable pnpm
- name: Set up cache for a NodeJS PNPM application
uses: milaboratory/github-ci/actions/node/cache-pnpm@v4
with:
cache-hashfiles-search-path: ${{ inputs.cache-hashfiles-search-path }}
cache-version: ${{ inputs.cache-version }}