Skip to content

0.0.15-preview-01

0.0.15-preview-01 #107

Workflow file for this run

name: 'Build and Deploy to GitHubPages'
env:
PUBLISH_DIR: examples/jsMind.WASM.App/bin/Release/net6.0/publish/wwwroot
# Controls when the action will run
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: BlazorWebAssemblyFileHashFixer 1
uses: stefh/ghaction-BlazorWebAssemblyFileHashFixer@v1
with:
wwwroot-path: '.'
- name: Publish app
run: dotnet publish -c Release examples/jsMind.WASM.App
- name: Rewrite base href
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: ${{ env.PUBLISH_DIR }}/index.html
base_href: /jsMind.Blazor/
- name: Patch blazor.webassembly.js for .NET 5
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "return r.loadResource\\(o,t\\(o\\),e\\[o\\],n\\)"
replace: "var p = r.loadResource(o,t(o),e[o],n); p.response.then((x) => { if (typeof window.loadResourceCallback === 'function') { window.loadResourceCallback(Object.keys(e).length, o, x);}}); return p;"
include: "**/blazor.webassembly.js"
- name: Patch blazor.webassembly.js for .NET 6
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "_STEF_NOT_NEEDED_this\\.loadResource\\(r,t\\(r\\),e\\[r\\],n\\)"
replace: "{ const stef = this.loadResource(r,t(r),e[r],n); stef.response.then((x) => { if (typeof window.loadResourceCallback === 'function') { window.loadResourceCallback(Object.keys(e).length || 1, r); } }); return stef; }"
include: "**/blazor.webassembly.js"
- name: BlazorWebAssemblyFileHashFixer 2
uses: stefh/ghaction-BlazorWebAssemblyFileHashFixer@v2
with:
wwwroot-path: ${{ env.PUBLISH_DIR }}
- name: CompressFiles
uses: stefh/ghaction-CompressFiles@v2
with:
path: ${{ env.PUBLISH_DIR }}
- name: GitHub Pages
if: success()
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: ${{ env.PUBLISH_DIR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}