2022-11-29 11:36:57 -05:00
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
name: Setup Node
|
|
|
|
description: "Setups node and configures the cache"
|
|
|
|
|
|
|
|
inputs:
|
2022-12-11 18:46:30 -05:00
|
|
|
NODEJS_VERSION:
|
2022-11-29 11:36:57 -05:00
|
|
|
required: true
|
2022-12-11 18:46:30 -05:00
|
|
|
description: "NodeJS version to install"
|
2022-11-29 11:36:57 -05:00
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Cache yarn cache
|
2023-09-08 12:11:12 -04:00
|
|
|
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
|
2022-11-29 11:36:57 -05:00
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
2023-02-18 09:27:49 -05:00
|
|
|
key: ${{ runner.os }}-yarn
|
2022-11-29 11:36:57 -05:00
|
|
|
|
|
|
|
- name: Set up NodeJS
|
2023-10-23 12:09:13 -04:00
|
|
|
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
|
2022-11-29 11:36:57 -05:00
|
|
|
with:
|
2022-12-11 18:46:30 -05:00
|
|
|
node-version: ${{ inputs.NODEJS_VERSION }}
|
2022-11-29 11:36:57 -05:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --immutable
|
|
|
|
working-directory: .
|
|
|
|
shell: bash
|