-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
63 lines (56 loc) · 1.68 KB
/
action.yml
File metadata and controls
63 lines (56 loc) · 1.68 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
name: setup-frontend
description: Sets up runner environment for frontend code.
inputs:
node-version:
description: Node.js version to use
default: '18'
required: false
type: string
yarn-version:
description: Yarn version to use
default: '1.22.19'
required: false
type: string
runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: set helper variable
shell: bash
env:
name: my_yarn_cache_path
value: yarn cache dir
run: echo "${name}=$(${value})" >> $GITHUB_ENV
- uses: actions/cache@v4
id: cache-yarn
with:
path: |
/usr/local/bin/yarn*
/usr/local/lib/node_modules/yarn
key: node${{ inputs.node-version }}-yarn${{ inputs.yarn-version }}
restore-keys: node${{ inputs.node-version }}-yarn
- name: conditionally install yarn
shell: bash
if: steps.cache-yarn.outputs.cache-hit != 'true'
working-directory: ./frontend
run: npm install --global yarn@${{ inputs.yarn-version }}
- uses: actions/cache@v4
id: cache-lockfile
with:
path: |
**/node_modules
${{ env.my_yarn_cache_path }}
key: node${{ inputs.node-version }}-lockfile${{ hashFiles('frontend/yarn.lock') }}
restore-keys: node${{ inputs.node-version }}-lockfile
- name: conditionally install dependencies
shell: bash
if: steps.cache-lockfile.outputs.cache-hit != 'true'
working-directory: ./frontend
run: >
yarn install
--frozen-lockfile
--non-interactive
--prefer-offline
--ignore-scripts