chore: refactor deployment workflow for Blazor WASM to Netlify, strea… #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 WASM to Netlify Pages | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| deploy-to-github-pages: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup .NET Core SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Publish Blazor WASM | |
| run: dotnet publish examples/FlowStateBlazorWasm/FlowStateBlazorWasm.csproj --configuration Release --output ./publish | |
| - name: copy index.html to 404.html | |
| run: cp publish/wwwroot/index.html publish/wwwroot/404.html | |
| - name: Add .nojekyll file | |
| run: touch publish/wwwroot/.nojekyll | |
| - name: Add ._redirect file | |
| run: echo "/* /index.html 200" > publish/wwwroot/_redirects | |
| - name: Commit wwwroot to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@3.7.1 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BRANCH: gh-pages | |
| FOLDER: publish/wwwroot |