2022-11-29 16:36:57 +00: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 23:46:30 +00:00
|
|
|
NODEJS_VERSION:
|
2022-11-29 16:36:57 +00:00
|
|
|
required: true
|
2022-12-11 23:46:30 +00:00
|
|
|
description: "NodeJS version to install"
|
2022-11-29 16:36:57 +00: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-02-25 12:41:38 +00:00
|
|
|
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
2022-11-29 16:36:57 +00:00
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
2023-02-18 14:27:49 +00:00
|
|
|
key: ${{ runner.os }}-yarn
|
2022-11-29 16:36:57 +00:00
|
|
|
|
|
|
|
- name: Set up NodeJS
|
2023-01-08 22:11:23 +00:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
2022-11-29 16:36:57 +00:00
|
|
|
with:
|
2022-12-11 23:46:30 +00:00
|
|
|
node-version: ${{ inputs.NODEJS_VERSION }}
|
2022-11-29 16:36:57 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --immutable
|
|
|
|
working-directory: .
|
|
|
|
shell: bash
|