Skip to content

Add a GitHub Actions Workflow to deploy the app to the GitHub Pages #2

Add a GitHub Actions Workflow to deploy the app to the GitHub Pages

Add a GitHub Actions Workflow to deploy the app to the GitHub Pages #2

Workflow file for this run

name: github pages
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Checkout the code
- uses: actions/checkout@v4
# Install .NET SDK
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Install .NET WebAssembly Tools
run: dotnet workload install wasm-tools
# Publish the site
- name: Add The "Publish GitHub Pages" package
run: dotnet add package PublishSPAforGitHubPages.Build --version 3.0.0
- name: Publish
run: dotnet publish BlazorWasmApp1.csproj -c Release -o public -p GHPages=true -f net9.0
# Deploy the site
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public/wwwroot
force_orphan: true