-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add another manual workflow for lab/test builds of WASM to GH Pages.
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
.github/workflows/dotnet-blazor-app-publish-to-gh-pages-beta.yml
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,72 @@ | ||
name: Publish Test .NET Blazor WASM app to GitHub Pages (separate url) | ||
|
||
on: | ||
# push: | ||
# branches: | ||
# - master | ||
workflow_dispatch: | ||
|
||
#Trigger when tag is created | ||
# push: | ||
# tags: | ||
# - 'v*.*.*' | ||
|
||
env: | ||
CONFIGURATION: "Release" | ||
|
||
PROJECT_FILE: "src/apps/Highbyte.DotNet6502.App.WASM/Highbyte.DotNet6502.App.WASM.csproj" | ||
PROJECT_GH_PAGES_DIR: "app-test" | ||
BUILD_OUTPUT_WORKING_DIR: "build" | ||
GH_PAGES_WORKING_DIR: "ghpages" | ||
GH_PAGES_BRANCH_NAME: "gh-pages" | ||
|
||
VERSION: "0.0.1-test" # Hardcoded version for test/lab builds | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the code | ||
- uses: actions/checkout@v4 | ||
|
||
# Get version from tag | ||
# - name: Get version from tag with 'v' prefix | ||
# run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV | ||
|
||
# Install .NET Core SDK | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Install DotNet workload - WASM tools | ||
run: | | ||
dotnet workload install wasm-tools | ||
# Create GitHub Pages root folder contents | ||
- name: Create GH root folder and add .nojekyll file do disable built-in Jekyll CMS | ||
run: | | ||
mkdir ${{ env.GH_PAGES_WORKING_DIR }} | ||
echo '' > ${{ env.GH_PAGES_WORKING_DIR }}/.nojekyll | ||
# Publish the Blazor WASM site to a build working folder | ||
- name: Publish | ||
# Note: Could not get -p:GHPagesInjectBrotliLoader=true to work. Gets error "Uncaught ReferenceError: Blazor is not defined" from "brotliloader.min.js" | ||
run: dotnet publish ${{ env.PROJECT_FILE }} -p:Version=${{ env.VERSION }} -c:${{ env.CONFIGURATION }} -p:GHPages=true -p:GHPagesBase="/${{ github.event.repository.name }}/${{ env.PROJECT_GH_PAGES_DIR }}/" -p:GHPagesInjectBrotliLoader=false -o:${{ env.BUILD_OUTPUT_WORKING_DIR }}/${{ env.PROJECT_GH_PAGES_DIR }} | ||
|
||
# Copy the published Blazor WASM site from wwwroot folder in publish output dir | ||
- name: Copy published wwwroot contents to a subdirectory in GH pages working dir root | ||
run: | | ||
cp -r ${{ env.BUILD_OUTPUT_WORKING_DIR }}/${{ env.PROJECT_GH_PAGES_DIR }}/wwwroot/ ${{ env.GH_PAGES_WORKING_DIR }}/${{ env.PROJECT_GH_PAGES_DIR }}/ | ||
# Deploy the Blazor WASM site | ||
- name: Deploy to Github Pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
# token: ${{ secrets.ACCESS_TOKEN }} # Use if custom token needed to another repo | ||
branch: ${{ env.GH_PAGES_BRANCH_NAME }} # The branch the action should deploy to. | ||
folder: ${{ env.GH_PAGES_WORKING_DIR }} # The folder the action should deploy. | ||
#target-folder: app #If not specified, the contents for folder above is copied to the root of the GH pages branch. | ||
single-commit: true | ||
clean: false | ||
clean-exclude: app/**/* # If clean: true, keep the live app folder in the gh-pages branch (where non lab/test builds are deployed to) |
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