Update deployment workflow to use peaceiris/actions-gh-pages #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
# Korrigierte Pfade | |
- name: Restore dependencies | |
run: dotnet restore LagerClient.Blazor.sln | |
- name: Build | |
run: dotnet build LagerClient.Blazor.sln --no-restore --configuration Release | |
- name: Publish | |
run: dotnet publish Client/Client.csproj -c Release -o release --nologo | |
# Füge .nojekyll-Datei hinzu, um Jekyll-Verarbeitung zu deaktivieren | |
- name: Add .nojekyll file | |
run: touch release/wwwroot/.nojekyll | |
# Ändere die base-href für GitHub Pages | |
- name: Change base-href in index.html | |
run: sed -i 's/<base href="\/" \/>/<base href="\/LagerClientBlazor\/" \/>/g' release/wwwroot/index.html | |
# Kopiere index.html zu 404.html, damit Routing funktioniert | |
- name: Copy index.html to 404.html | |
run: cp release/wwwroot/index.html release/wwwroot/404.html | |
# Deployment auf GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./release/wwwroot |