Files
hedgedoc-hedgeagent/.github/actions/setup-node/action.yml
Erik Michelson e9a2c514dd fix(ci): include node version in yarn cache
The dependency set may differ between node versions.
This fixed caching makes it harder for version-specific deps and
might introduce bugs therefore. We now include the node version
in the cache key.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-06-18 23:00:01 +02:00

37 lines
1.0 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@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-node${{ inputs.NODEJS_VERSION }}-yarn-master
- name: Set up NodeJS
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ inputs.NODEJS_VERSION }}
- name: Install dependencies
run: yarn install --immutable
working-directory: .
shell: bash