Update CodeQL workflow to use latest actions #4
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 ] | |
| 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 | |
| run: | | |
| sed -i 's/<base href="\/" \/>/<base href="\/Blazor\/" \/>/g' release/wwwroot/index.html | |
| - name: π Add .nojekyll file | |
| run: touch release/wwwroot/.nojekyll | |
| - name: π Add custom 404.html | |
| run: cp release/wwwroot/index.html release/wwwroot/404.html | |
| - 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 | |