Deplay nochmal geändert. #4
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 ] # Oder dein primärer Branch-Name | |
| 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 # Dotnet version anpassen | |
| - name: Publish Sample Project | |
| # Wir erzwingen hier den Output-Pfad absolut sauber | |
| run: dotnet publish samples/Blazor.SimpleGrid.Sample/Blazor.SimpleGrid.Sample.csproj -c Release -o output | |
| - name: Debug Output (Optional) | |
| # Dieser Schritt zeigt dir im Log genau, wo die Dateien gelandet sind | |
| run: ls -R output | |
| - name: Fix Paths for GitHub Pages | |
| run: | | |
| # Wir wissen, dass Blazor WASM die index.html in wwwroot ablegt | |
| INDEX_FILE="output/wwwroot/index.html" | |
| if [ -f "$INDEX_FILE" ]; then | |
| echo "Korrektur der index.html wird ausgeführt..." | |
| # Ersetze REPO_NAME durch deinen exakten GitHub-Repo-Namen | |
| sed -i 's/<base href="\/" \/>/<base href="\/Blazor.SimpleGrid\/" \/>/g' "$INDEX_FILE" | |
| cp "$INDEX_FILE" "output/wwwroot/404.html" | |
| else | |
| echo "FEHLER: index.html wurde nicht unter $INDEX_FILE gefunden!" | |
| exit 1 | |
| fi | |
| - name: Upload to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: output/wwwroot # Wir laden nur den Inhalt von wwwroot hoch | |
| branch: gh-pages |