Add Blazor WebAssembly app and CI/CD workflow for HealthNerd #13
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: ['**'] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Install WASM workload | |
| run: dotnet workload install wasm-tools | |
| - name: Restore | |
| run: dotnet restore src/HealthNerd.Wasm/HealthNerd.Wasm.csproj | |
| - name: Build | |
| run: dotnet build src/HealthNerd.Wasm/HealthNerd.Wasm.csproj -c Release --no-restore -v normal 2>&1 | tee /tmp/build-output.txt; exit ${PIPESTATUS[0]} | |
| - name: Show build errors | |
| if: failure() | |
| run: grep -E "error CS|Error\(s\)|error :" /tmp/build-output.txt || cat /tmp/build-output.txt | |
| - name: Publish (dry-run to verify WASM output) | |
| run: dotnet publish src/HealthNerd.Wasm/HealthNerd.Wasm.csproj -c Release --no-restore -o ./publish | |
| - name: Verify output exists | |
| run: | | |
| ls -la publish/wwwroot/ | |
| test -f publish/wwwroot/index.html | |
| test -f publish/wwwroot/_framework/blazor.webassembly.js |