Skip to content

Merge pull request #7 from JsonViewer-Component/dependabot/nuget/src/… #10

Merge pull request #7 from JsonViewer-Component/dependabot/nuget/src/…

Merge pull request #7 from JsonViewer-Component/dependabot/nuget/src/… #10

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_VERSION: '7.0.x'
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@v6
- name: βš™οΈ Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- 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: |
# Fix base href for GitHub Pages subdirectory
sed -i 's|<base href="/" />|<base href="/Blazor/" />|g' release/wwwroot/index.html
echo "βœ… Base href updated to /Blazor/"
grep "<base" release/wwwroot/index.html
- 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