Deply nochmals geändert. #3
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 | |
| run: dotnet publish samples/Blazor.SimpleGrid.Sample/Blazor.SimpleGrid.Sample.csproj -c Release -o release | |
| # Wir suchen die index.html jetzt direkt im gesamten release-Ordner | |
| - name: Change base-tag in index.html | |
| run: | | |
| FILE_PATH=$(find release -name index.html) | |
| echo "Found index.html at: $FILE_PATH" | |
| sed -i 's/<base href="\/" \/>/<base href="\/Blazor.SimpleGrid\/" \/>/g' $FILE_PATH | |
| # Auch hier suchen wir die Datei dynamisch, um sie als 404.html zu kopieren | |
| - name: Copy index.html to 404.html | |
| run: | | |
| FILE_PATH=$(find release -name index.html) | |
| DIR_PATH=$(dirname $FILE_PATH) | |
| cp $FILE_PATH "$DIR_PATH/404.html" | |
| - name: Upload to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: release/wwwroot # Falls dotnet publish den Ordner so erstellt | |
| branch: gh-pages |