Skip to content

publish of the template #38

publish of the template

publish of the template #38

name: Build and publish to gh pages
on:
push:
branches: ["*"]
env:
ASPNETCORE_ENVIRONMENT: Production
WEBAPP_PATH: ./
WEBAPP_CSPROJ: BlazorStaticMinimalBlog.csproj
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Remove launchSettings.json (to not override ASPNETCORE_ENVIRONMENT)
run: rm ${{ env.WEBAPP_PATH }}Properties/launchSettings.json
- run: touch ${{ env.WEBAPP_PATH }}/wwwroot/.nojekyll #folder starting with _ are handled as jekyll. This file will prevent that.
- name: Run webapp and generate static files
run: |
dotnet run --project ${{ env.WEBAPP_PATH }}${{env.WEBAPP_CSPROJ}} --configuration Release
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ${{ env.WEBAPP_PATH }}output