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
- Host: GitHub
- URL: https://github.com/jeepnl/blazorbits
- Owner: JeepNL
- License: mit
- Created: 2020-07-10T17:19:06.000Z (almost 6 years ago)
- Default Branch: development
- Last Pushed: 2020-07-12T21:17:14.000Z (almost 6 years ago)
- Last Synced: 2025-01-28T03:15:14.818Z (over 1 year ago)
- Topics: blazor, blazor-webassembly, github-actions, github-pages, wasm, webassembly
- Language: HTML
- Homepage:
- Size: 4.12 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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**

#### [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...