Validating the Building of Public Assets #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | |
} |