Skip to content

Commit 2c67855

Browse files
author
Sebastian-Debian
committed
nochmal
1 parent 57006e6 commit 2c67855

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

.github/workflows/deploy-demo.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,26 @@ jobs:
2121

2222
- name: Fix for GitHub Pages
2323
run: |
24-
# 1. Base Href in der index.html anpassen
25-
# Wir suchen die index.html dynamisch, falls der Pfad leicht abweicht
26-
INDEX_PATH=$(find output/wwwroot -name "index.html")
27-
echo "Found index.html at: $INDEX_PATH"
28-
sed -i 's|<base href=".*" />|<base href="/Blazor.SimpleGrid/" />|g' "$INDEX_PATH"
29-
30-
# 2. Integritätsprüfung deaktivieren (Sucht die boot.json automatisch)
31-
# Wir suchen nach jeder .json Datei, die mit 'blazor.boot' beginnt
32-
BOOT_JSON=$(find output/wwwroot -name "blazor.boot.json")
24+
# Pfad finden
25+
INDEX_PATH="output/wwwroot/index.html"
26+
27+
echo "Patche index.html unter $INDEX_PATH"
28+
29+
# Wir ersetzen ALLES was im base href steht durch den Repo-Namen.
30+
# WICHTIG: Achte darauf, dass hier EXAKT dein Repo-Name steht (Groß/Kleinschreibung!)
31+
sed -i 's|<base href="[^"]*" />|<base href="/Blazor.SimpleGrid/" />|g' "$INDEX_PATH"
3332
33+
# Falls deine index.html das Format <base href="/"> ohne Leerzeichen nutzt:
34+
sed -i 's|<base href="[^"]*">|<base href="/Blazor.SimpleGrid/">|g' "$INDEX_PATH"
35+
36+
# Integrität deaktivieren (für die 404er nicht primär, aber wichtig für danach)
37+
BOOT_JSON=$(find output/wwwroot -name "blazor.boot.json")
3438
if [ -f "$BOOT_JSON" ]; then
35-
echo "Found boot.json at: $BOOT_JSON - Disabling integrity..."
3639
sed -i 's/"sha256-[^"]*"/"sha256-ignore"/g' "$BOOT_JSON"
37-
else
38-
echo "Warning: blazor.boot.json not found, skipping integrity fix."
39-
# Falls die Datei nicht existiert, listen wir zur Sicherheit den Inhalt auf
40-
ls -R output/wwwroot/_framework
4140
fi
4241
43-
# 3. 404.html erstellen
44-
cp "$INDEX_PATH" "output/wwwroot/404.html"
42+
# 404 fix
43+
cp "$INDEX_PATH" output/wwwroot/404.html
4544
4645
- name: Upload to GitHub Pages
4746
uses: JamesIves/github-pages-deploy-action@v4

0 commit comments

Comments
 (0)