2022-11-29 11:36:57 -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:
|
|
|
|
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
|
2023-01-08 17:11:23 -05:00
|
|
|
uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
|
2022-11-29 11:36:57 -05:00
|
|
|
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
|
2023-01-08 17:11:23 -05:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
2022-11-29 11:36:57 -05:00
|
|
|
with:
|
|
|
|
node-version: ${{ inputs.NODE_VERSION }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --immutable
|
|
|
|
working-directory: .
|
|
|
|
shell: bash
|
2022-12-04 16:41:39 -05:00
|
|
|
|
|
|
|
- name: Build commons lib
|
|
|
|
run: yarn build
|
|
|
|
working-directory: commons
|
|
|
|
shell: bash
|