2023-02-19 16:42:32 -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:
|
|
|
|
NODEJS_VERSION:
|
|
|
|
required: true
|
|
|
|
description: "NodeJS version to install"
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
2023-05-28 13:51:57 -04:00
|
|
|
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
2023-02-19 16:42:32 -05:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Cache yarn cache
|
2023-09-08 11:40:42 -04:00
|
|
|
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
|
2023-02-19 16:42:32 -05:00
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-master
|
|
|
|
|
|
|
|
- name: Set up NodeJS
|
2023-08-17 09:31:30 -04:00
|
|
|
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
|
2023-02-19 16:42:32 -05:00
|
|
|
with:
|
|
|
|
node-version: ${{ inputs.NODEJS_VERSION }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
2023-05-28 13:51:57 -04:00
|
|
|
run: yarn install --immutable
|
2023-02-19 16:42:32 -05:00
|
|
|
working-directory: .
|
|
|
|
shell: bash
|