Skip to content

Commit

Permalink
Create deploy-blazor-wasm.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tscholze committed May 20, 2024
1 parent c702867 commit f004e11
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy-blazor-wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy Blazor WASM to GitHub Page
env:
PUBLISH_DIR: bin/Release/net8.0/publish/wwwroot

# Controls when the action will run
on:
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./MyLife.Blazor.Wasm

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: dotnet workload install wasm-tools

- name: Publish application
run: dotnet publish -c Release

- name: Rewrite base href
if: success()
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: ${{ env.PUBLISH_DIR }}/index.html
base_href: BASE_URL or REPOSITORY_NAME

# add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project. (Allow files and folders starting with an underscore)
- name: Add .nojekyll file
run: touch ${{ env.PUBLISH_DIR }}/.nojekyll

- name: Commit to GitHub pages Repo
if: success()
uses: crazy-max/ghaction-github-pages@v1.5.1
with:
target_branch: gh-pages
build_dir: ${{ env.PUBLISH_DIR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f004e11

Please sign in to comment.