Update GitHub Actions workflow to enable use of GitHub Packages befor… #109
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: github pages | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the code | |
| - uses: actions/checkout@v5 | |
| # Remove global.json before installing .NET SDK | |
| - name: Remove global.json | |
| run: rm -f global.json | |
| # Install .NET SDK | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: Install .NET WebAssembly Tools | |
| run: dotnet workload install wasm-tools | |
| # Add GitHub Packages as a NuGet source | |
| - name: Add GitHub Packages source | |
| run: dotnet nuget add source "https://nuget.pkg.github.com/jsakamoto/index.json" --name "GitHubPackages" --username "jsakamoto" --password "${{ secrets.GITHUB_TOKEN }}" --store-password-in-clear-text | |
| # Publish the site | |
| - name: Publish | |
| run: dotnet publish BlazorWasmApp1.csproj -o ../../public -p GHPages=true --nologo | |
| working-directory: ./SampleApps/BlazorWasmApp1 | |
| # Deploy the site | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: public/wwwroot | |
| force_orphan: true |