-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (60 loc) · 2.38 KB
/
Copy pathdeploy-blazor.yml
File metadata and controls
75 lines (60 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Deploy Blazor WASM to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# The net10.0 test executable needs the .NET 10 runtime.
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
# The app sets WasmEnableThreads, whose multithreaded runtime (the one carrying
# JavaScriptExports.InstallMainSynchronizationContext) ships in the wasm-tools workload. Without
# it the build emits a single-threaded runtime that aborts at start_runtime in the browser.
- name: Install wasm-tools workload
run: dotnet workload install wasm-tools
- name: Build tests (also publishes the Blazor app for snapshot tests)
run: dotnet build src/GeoConvert.Web.Tests --configuration Release
# TUnit ships as an executable on Microsoft.Testing.Platform; run it directly rather than via
# `dotnet test`, which rejects it under the VSTest path.
- name: Run tests
run: dotnet src/GeoConvert.Web.Tests/bin/Release/net10.0/GeoConvert.Web.Tests.dll
- name: Publish
run: dotnet publish src/GeoConvert.Web --configuration Release --output publish
# The site is served at the root of the custom domain, so the published <base href="/" /> is
# already correct — no subpath rewrite. (When it was served from the GitHub Pages project subpath
# https://papyrine.github.io/GeoConvert/, this step rewrote the base to "/GeoConvert/"; the custom
# domain made that rewrite wrong.)
- name: Add .nojekyll file
run: touch publish/wwwroot/.nojekyll
- name: Copy index.html to 404.html for SPA routing
run: cp publish/wwwroot/index.html publish/wwwroot/404.html
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: publish/wwwroot
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4