oncall-engine/.github/actions/install-frontend-dependencies/action.yml
2025-05-01 09:36:52 -04:00

35 lines
1.4 KiB
YAML

name: Install frontend dependencies
description: Setup node/pnpm + install frontend dependencies
inputs:
oncall-directory:
description: "Relative path to oncall directory"
required: false
default: "."
runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
with:
version: 9.1.4
- name: Determine grafana-plugin directory location
id: grafana-plugin-directory
shell: bash
env:
ONCALL_DIRECTORY: ${{ inputs.oncall-directory }}
run: echo "grafana-plugin-directory=${{ env.ONCALL_DIRECTORY }}/grafana-plugin" >> $GITHUB_OUTPUT
- name: Determine pnpm-lock.yaml location
id: pnpm-lock-location
shell: bash
# yamllint disable rule:line-length
run: echo "pnpm-lock-location=${{ steps.grafana-plugin-directory.outputs.grafana-plugin-directory }}/pnpm-lock.yaml" >> $GITHUB_OUTPUT
# yamllint enable rule:line-length
- uses: actions/setup-node@v4
with:
node-version: 20.15.1
cache: pnpm
cache-dependency-path: ${{ steps.pnpm-lock-location.outputs.pnpm-lock-location }}
- name: Install frontend dependencies
shell: bash
working-directory: ${{ steps.grafana-plugin-directory.outputs.grafana-plugin-directory }}
run: pnpm install --frozen-lockfile --prefer-offline