Files
nextcloud-app-api/.github/workflows/node-build.yml
Julien Veyssier 8b8e894df2 change npm version in actions
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-11-19 14:58:51 +01:00

56 lines
1.4 KiB
YAML

# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Node Build
on:
pull_request:
paths:
- src/**
- .eslintrc.js
- stylelint.config.js
- webpack.js
push:
branches:
- main
paths:
- src/**
- .eslintrc.js
- stylelint.config.js
- webpack.js
jobs:
build:
name: node-build
runs-on: ubuntu-latest
steps:
- name: Set app env
run: echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
path: ${{ env.APP_NAME }}
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
path: ${{ env.APP_NAME }}
fallbackNode: "^20"
fallbackNpm: "^10"
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Build ${{ env.APP_NAME }}
run: |
cd ${{ env.APP_NAME }}
npm ci
npm run build