hedgedoc/.github/actions/setup-node/action.yml
renovate[bot] 50e3452574 chore(deps): update actions/cache action to v3.2.3
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-14 21:55:58 +01:00

43 lines
1.2 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:
NODE_VERSION:
required: true
type: string
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@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ inputs.NODE_VERSION }}-yarn-${{ hashFiles('frontend/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ inputs.NODE_VERSION }}
- name: Set up NodeJS
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: ${{ inputs.NODE_VERSION }}
- name: Install dependencies
run: yarn install --immutable
working-directory: .
shell: bash
- name: Build commons lib
run: yarn build
working-directory: commons
shell: bash