-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
33 lines (29 loc) · 942 Bytes
/
action.yaml
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
name: "Setup JS project using Yarn"
description: "Setup Node.js and Install dependencies."
inputs:
cache:
description: 'Enable TurboRepo Remote Cache, "node_modules/*" and ".yarn/cache/*", default: "true"'
required: false
default: 'true'
runs:
using: "composite"
steps:
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
cache: ${{ inputs.cache == 'true' && 'yarn' || '' }}
node-version: 20.x
- name: Restore node_modules
if: ${{ inputs.cache == 'true' }}
uses: actions/cache@v4
with:
path: |
.yarn/install-state.gz
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-1
- name: Install Dependencies
shell: bash
run: yarn install --immutable
- name: Run Turborepo Remote Cache
if: ${{ inputs.cache == 'true' }}
uses: dtinth/[email protected]