release: prepare v0.0.3-beta #16
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 ] | |
| 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@v4 | |
| - 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 |