Remove unused files and components from JsonViewerComponent #5
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 Blazor to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'src/**' | |
| - 'samples/**' | |
| - '.github/workflows/pages.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| # ======================================== | |
| # 1️⃣ Checkout Repository | |
| # ======================================== | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| # ======================================== | |
| # 2️⃣ Setup .NET SDK | |
| # ======================================== | |
| - name: 🔧 Setup .NET 8.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| # ======================================== | |
| # 3️⃣ Restore NuGet packages | |
| # ======================================== | |
| - name: 📦 Restore dependencies | |
| run: dotnet restore samples/BlazorWasm.NET8/BlazorWasm.NET8.csproj | |
| # ======================================== | |
| # 4️⃣ Publish Blazor WASM | |
| # ======================================== | |
| - name: 🏗️ Publish Blazor WASM | |
| run: | | |
| dotnet publish samples/BlazorWasm.NET8/BlazorWasm.NET8.csproj \ | |
| -c Release \ | |
| -o publish \ | |
| -p:GHPages=true \ | |
| -p:BlazorEnableCompression=false | |
| # ======================================== | |
| # 5️⃣ Fix base href for GitHub Pages | |
| # ======================================== | |
| - name: 🔧 Update base href | |
| run: | | |
| sed -i 's|<base href="/" />|<base href="/Blazor/" />|g' publish/wwwroot/index.html | |
| echo "✅ Base href updated to /Blazor/" | |
| # ======================================== | |
| # 6️⃣ Add .nojekyll file | |
| # ======================================== | |
| - name: 📝 Add .nojekyll | |
| run: | | |
| touch publish/wwwroot/.nojekyll | |
| echo "✅ .nojekyll file created" | |
| # ======================================== | |
| # 7️⃣ Add 404 fallback for SPA routing | |
| # ======================================== | |
| - name: 🔄 Create 404.html | |
| run: | | |
| cp publish/wwwroot/index.html publish/wwwroot/404.html | |
| echo "✅ 404.html created for SPA routing" | |
| # ======================================== | |
| # 8️⃣ List published files (for debugging) | |
| # ======================================== | |
| - name: 📋 List published files | |
| run: | | |
| echo "📂 Contents of publish/wwwroot:" | |
| ls -lah publish/wwwroot/ | |
| echo "" | |
| echo "📄 index.html base href:" | |
| grep "<base" publish/wwwroot/index.html | |
| # ======================================== | |
| # 9️⃣ Setup GitHub Pages | |
| # ======================================== | |
| - name: ⚙️ Setup Pages | |
| uses: actions/configure-pages@v4 | |
| # ======================================== | |
| # 🔟 Upload artifact | |
| # ======================================== | |
| - name: 📤 Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'publish/wwwroot' | |
| # ======================================== | |
| # 1️⃣1️⃣ Deploy to GitHub Pages | |
| # ======================================== | |
| - name: 🚀 Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |