nochmale #10
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: Deploy Demo to GitHub Pages | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 10.0.x # Oder 9.0.x, je nach deinem Projekt | |
| - name: Publish WASM Project | |
| # Hier den Pfad zu deinem NEUEN Projekt anpassen: | |
| run: dotnet publish samples/Blazor.SimpleGrid.WasmSample/Blazor.SimpleGrid.WasmSample.csproj -c Release -o output | |
| - name: Fix for GitHub Pages | |
| run: | | |
| # 1. Base Href patchen (wirklich alles zwischen den Anführungszeichen ersetzen) | |
| # Ersetze Blazor.SimpleGrid durch den EXAKTEN Namen deines Repos (Groß/Kleinschreibung!) | |
| sed -i 's|<base href="[^"]*" />|<base href="/Blazor.SimpleGrid/" />|g' output/wwwroot/index.html | |
| # 2. Integrität deaktivieren (wegen der 404/Hash-Probleme auf GH Pages) | |
| # Wir suchen alle JSON-Dateien im _framework Ordner (auch die mit Fingerprints) | |
| find output/wwwroot/_framework -name "*.json" -exec sed -i 's/"sha256-[^"]*"/"sha256-ignore"/g' {} + | |
| # 3. 404 fix (für Routing) | |
| cp output/wwwroot/index.html output/wwwroot/404.html | |
| - name: Upload to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: output/wwwroot | |
| branch: gh-pages |