File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [ main ] # Oder master, je nach Hauptbranch
6+
7+ jobs :
8+ deploy :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+
13+ - name : Setup .NET
14+ uses : actions/setup-dotnet@v4
15+ with :
16+ dotnet-version : ' 10.0.x' # Passe deine .NET Version an (z. B. 7.0.x, 8.0.x, 9.0.x)
17+
18+ - name : Publish App
19+ run : dotnet publish -c Release -o output
20+
21+ # Jekyll ignorieren, damit _framework Pfade geladen werden
22+ - name : Add .nojekyll file
23+ run : touch output/wwwroot/.nojekyll
24+
25+ # Base-Tag anpassen (ersetze REPOSITORY_NAME mit deinem GitHub Repo Namen)
26+ - name : Fix base path
27+ run : |
28+ sed -i 's///g' output/wwwroot/index.html
29+
30+ # 404 Fallback für Client-Side Routing
31+ - name : Copy index.html to 404.html
32+ run : cp output/wwwroot/index.html output/wwwroot/404.html
33+
34+ - name : Deploy to GitHub Pages
35+ uses : JamesIves/github-pages-deploy-action@v4
36+ with :
37+ folder : output/wwwroot
38+ branch : gh-pages
You can’t perform that action at this time.
0 commit comments