Skip to content

Update custom-action-test.yml #10

Update custom-action-test.yml

Update custom-action-test.yml #10

name: Deploy to GitHub Pages
env:
PUBLISH_DIR: src/AspNet.Core.Blazor.WebAssembly/bin/Release/net8.0/publish/wwwroot
on:
push:
branches: [ main ]
# Allow manual trigger
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Publish app
run: dotnet publish ./src/AspNet.Core.Blazor.WebAssembly/AspNet.Core.Blazor.WebAssembly.csproj -c Release
- name: Rewrite base href
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1.1.0
with:
html_path: ${{ env.PUBLISH_DIR }}/index.html
base_href: /github-services/
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: published-app
path: ${{ env.PUBLISH_DIR }}
deploy:
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
actions: read
contents: write
environment:
name: github-pages
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: published-app
path: ./wwwroot
- name: GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: ./wwwroot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}