Skip to content

und nochmal

und nochmal #8

Workflow file for this run

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 in der index.html anpassen
# Wir suchen die index.html dynamisch, falls der Pfad leicht abweicht
INDEX_PATH=$(find output/wwwroot -name "index.html")
echo "Found index.html at: $INDEX_PATH"
sed -i 's|<base href=".*" />|<base href="/Blazor.SimpleGrid/" />|g' "$INDEX_PATH"
# 2. Integritätsprüfung deaktivieren (Sucht die boot.json automatisch)
# Wir suchen nach jeder .json Datei, die mit 'blazor.boot' beginnt
BOOT_JSON=$(find output/wwwroot -name "blazor.boot.json")
if [ -f "$BOOT_JSON" ]; then
echo "Found boot.json at: $BOOT_JSON - Disabling integrity..."
sed -i 's/"sha256-[^"]*"/"sha256-ignore"/g' "$BOOT_JSON"
else
echo "Warning: blazor.boot.json not found, skipping integrity fix."
# Falls die Datei nicht existiert, listen wir zur Sicherheit den Inhalt auf
ls -R output/wwwroot/_framework
fi
# 3. 404.html erstellen
cp "$INDEX_PATH" "output/wwwroot/404.html"
- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: output/wwwroot
branch: gh-pages