Skip to content

Build Blazor

Build Blazor #86

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [ "master" ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Restore workload
run: dotnet workload restore
- name: Build and Publish
run: dotnet publish 'LaunchApp/' -c Release -o publish
- name: Setup SPA routing
run: |
cp publish/wwwroot/index.html publish/wwwroot/404.html
sed -i 's/base href="\/"/base href="\/${{ github.event.repository.name }}\/"/' publish/wwwroot/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './publish/wwwroot'
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4