-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |