Skip to content

fix: Restore demo-only deployment and fix documentation link #23

fix: Restore demo-only deployment and fix documentation link

fix: Restore demo-only deployment and fix documentation link #23

Workflow file for this run

name: πŸš€ Deploy to GitHub Pages
on:
push:
branches: [ main ]
paths:
- 'src/**'
- '.github/workflows/deploy-pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
jobs:
build:
name: πŸ—οΈ Build Blazor WASM
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout
uses: actions/checkout@v4
- name: βš™οΈ Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: πŸ“¦ Restore dependencies
run: dotnet restore JsonViewer.Blazor.sln
- name: πŸ—οΈ Build
run: dotnet build JsonViewer.Blazor.sln --configuration Release --no-restore
- name: πŸ“¦ Publish Blazor WASM
run: |
dotnet publish src/Blazor.Demo/Blazor.Demo.csproj \
-c Release \
-o release \
--nologo
- name: πŸ”§ Configure base path for GitHub Pages
run: |
sed -i 's|<base href="/" />|<base href="/Blazor/" />|g' release/wwwroot/index.html
echo "βœ… Base href updated to /Blazor/"
- name: πŸ“ Add .nojekyll file
run: touch release/wwwroot/.nojekyll
- name: πŸ“ Create 404.html for SPA routing
run: cp release/wwwroot/index.html release/wwwroot/404.html
- name: πŸ“‹ List published files
run: |
echo "πŸ“‚ Contents of release/wwwroot:"
ls -la release/wwwroot/
- name: βš™οΈ Setup Pages
uses: actions/configure-pages@v5
- name: πŸ“€ Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: release/wwwroot
deploy:
name: πŸš€ Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: 🌐 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4