Skip to content

Validating the Building of Public Assets #17

Validating the Building of Public Assets

Validating the Building of Public Assets #17

name: Frontend Assets build validation
on:
# Manual trigger.
workflow_dispatch:
jobs:
test-npm-build:
name: Test building assets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Rebuild packages
run: |
npm install
npm run rebuild
- name: Check if git has changes
shell: pwsh
run: |
$changes = git status --porcelain
if ($changes)
{
Write-Output 'Please make sure to build the assets properly before pushing, see https://docs.orchardcore.net/en/latest/docs/guides/gulp-pipeline/.'
Write-Output 'The following files changed:'
Write-Output $changes
exit -1
}
else
{
Write-Host "No uncommitted changes found. Repository is clean."
}