-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.66 KB
/
deploy-demo.yml
File metadata and controls
49 lines (38 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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: |
# Pfad finden
INDEX_PATH="output/wwwroot/index.html"
echo "Patche index.html unter $INDEX_PATH"
# Wir ersetzen ALLES was im base href steht durch den Repo-Namen.
# WICHTIG: Achte darauf, dass hier EXAKT dein Repo-Name steht (Groß/Kleinschreibung!)
sed -i 's|<base href="[^"]*" />|<base href="/Blazor.SimpleGrid/" />|g' "$INDEX_PATH"
# Falls deine index.html das Format <base href="/"> ohne Leerzeichen nutzt:
sed -i 's|<base href="[^"]*">|<base href="/Blazor.SimpleGrid/">|g' "$INDEX_PATH"
# Integrität deaktivieren (für die 404er nicht primär, aber wichtig für danach)
BOOT_JSON=$(find output/wwwroot -name "blazor.boot.json")
if [ -f "$BOOT_JSON" ]; then
sed -i 's/"sha256-[^"]*"/"sha256-ignore"/g' "$BOOT_JSON"
fi
# 404 fix
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