Merge pull request #76 from peopleworks/pelic-corpus #106
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
| # Alternative to Azure Static Web Apps: publish the WASM app to GitHub Pages. | |
| # Enable Pages in repo Settings → Pages → Source: "GitHub Actions", then this runs on push to main. | |
| name: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Publish | |
| run: dotnet publish src/SignsOfAI.Web -c Release -o publish | |
| # Project sites live at /<repo>/, so rewrite the base href from "/" to "/<repo>/". | |
| - name: Rewrite base href | |
| run: | | |
| sed -i 's|<base href="/" />|<base href="/${{ github.event.repository.name }}/" />|g' publish/wwwroot/index.html | |
| # SPA deep links (e.g. /catalog) 404 on Pages without a fallback — serve index.html as 404. | |
| - name: SPA fallback | |
| run: cp publish/wwwroot/index.html publish/wwwroot/404.html | |
| - uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: publish/wwwroot | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v5 |