Skip to content

Commit

Permalink
Run npm javascript build only if package.json exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tsdicloud committed Aug 9, 2023
1 parent 442fcb4 commit 3fc6cc4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/nmc-app-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,26 @@ jobs:
# the node.js, npm install procedure is taken over from upstream Nextcloud
# command-compile.yml
- name: Detect NC compatible node.js,npm
if: ${{ hashFiles('package.json') != '' }}
uses: skjnldsv/[email protected]
id: package-engines-versions
with:
fallbackNode: '^16'
fallbackNpm: '^7'

- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
if: ${{ hashFiles('package.json') != '' }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
cache: npm

- name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }}
if: ${{ hashFiles('package.json') != '' }}
run: npm i -g npm@"${{ steps.package-engines-versions.outputs.npmVersion }}"

- name: Build composer dependencies, sass, webpacks
if: ${{ hashFiles('package.json') != '' }}
run: |
npm ci
npm run build --if-present
Expand Down

0 comments on commit 3fc6cc4

Please sign in to comment.