hedgedoc/.github/actions/setup-node/action.yml
Erik Michelson 305b6f5910 misc: add turbo monorepo util
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Co-authored-by: David Mehren <git@herrmehren.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-07 21:38:40 +01:00

38 lines
1.1 KiB
YAML

# 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:
NODEJS_VERSION:
required: true
description: "NodeJS version to install"
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
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ inputs.NODEJS_VERSION }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ inputs.NODEJS_VERSION }}
- name: Set up NodeJS
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: ${{ inputs.NODEJS_VERSION }}
- name: Install dependencies
run: yarn install --immutable
working-directory: .
shell: bash