An open API service indexing awesome lists of open source software.

https://github.com/jeepnl/blazorbits

Blazor WebAssembly (WASM) website automatically deployed on GitHub Pages using GitHub Actions
https://github.com/jeepnl/blazorbits

blazor blazor-webassembly github-actions github-pages wasm webassembly

Last synced: 2 months ago
JSON representation

Blazor WebAssembly (WASM) website automatically deployed on GitHub Pages using GitHub Actions

Awesome Lists containing this project

README

          

# Blazor Bits WebAssembly on GitHub Pages

**Automatically deployed on GitHub Pages ([https://jeepnl.github.io/BlazorBits/](https://jeepnl.github.io/BlazorBits/)) using GitHub Actions**

![gh-pages](https://github.com/JeepNL/BlazorBits/workflows/gh-pages/badge.svg)

#### [Change Log](CHANGELOG.md)

##### To deploy your Blazor WebAssembly App automatically to GitHub Pages you'll need to:

1. Have a 'master' and a 'development' branch.
- The 'master' branch is mandatory. GitHub Pages needs a 'master' branch. You can use any name for the 'development' branch.
2. Make the 'development' branch the default branch.
3. GitHub Actions will deploy to the 'master' branch.
4. Follow [Davide Guida](https://twitter.com/DavideGuida82)'s blog post "[How to deploy Blazor webassembly on GitHub Pages using GitHub Actions](https://www.davideguida.com/how-to-deploy-blazor-webassembly-on-github-pages-using-github-actions/)"
5. Don't forget to enable GitHub Pages on the Master Branche: `Settings` -> `Options` -> `GitHub Pages`

#### Recipes

##### 1. Blazor WebAssembly Browser Compatibility Check

(_wwwroot/[index.html](BlazorBits/wwwroot/index.html)_)




// See: https://medium.com/@waelkdouh/how-to-detect-unsupported-browsers-under-a-blazor-webassembly-application-bc11ab0ee015
// Check if webassembly is supported
const webassemblySupported = (function () {
try {
if (typeof WebAssembly === "object"
&& typeof WebAssembly.instantiate === "function") {
const module = new WebAssembly.Module(
Uint8Array.of(0x0, 0x61, 0x73, 0x6d,
0x01, 0x00, 0x00, 0x00));
if (module instanceof WebAssembly.Module)
return new WebAssembly.Instance(module)
instanceof WebAssembly.Instance;
}
} catch (e) {
}
return false;
})();
// Modern browsers e.g. Microsoft Edge
if (webassemblySupported) {
Blazor.start({});
}
// Older browsers e.g. IE11
else {
window.location = window.location + "BrowserNotSupported.html"; // NOTE: You'll need to create this file
}

##### 2. Blazor Loading Screen

(_wwwroot/[index.html](BlazorBits/wwwroot/index.html)_)




Blazor Bits GitHub Pages


The app is loading



Loading...