-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.27 KB
/
deploy-demo.yml
File metadata and controls
39 lines (32 loc) · 1.27 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
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