Skip to content

Commit db0dd2c

Browse files
LostBeardclaude
andcommitted
Add GitHub Pages deployment workflow + SPA 404 redirect
GitHub Actions workflow (deploy-ghpages.yml): - Triggers on push to master or manual dispatch - Checks out with submodules (sipsorcery) - Installs .NET 10 + wasm-tools workload - Publishes Blazor WASM demo - Updates base href for /SpawnDev.RTC/ subdirectory - Deploys to GitHub Pages 404.html: SPA redirect for Blazor client-side routing on GitHub Pages. The demo is serverless - uses RTCTrackerClient with openwebtorrent, no backend needed. Deploy to GitHub Pages and it just works. Co-Authored-By: Todd Tanner <lostit1278@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7084181 commit db0dd2c

4 files changed

Lines changed: 558 additions & 479 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy Blazor Demo to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
submodules: true
27+
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: '10.0.x'
32+
33+
- name: Install wasm-tools
34+
run: dotnet workload install wasm-tools
35+
36+
- name: Publish Blazor WASM
37+
run: dotnet publish SpawnDev.RTC.Demo/SpawnDev.RTC.Demo.csproj -c Release -o publish
38+
39+
- name: Configure base path for GitHub Pages
40+
run: |
41+
# Update base href for GitHub Pages subdirectory
42+
sed -i 's|<base href="/" />|<base href="/SpawnDev.RTC/" />|g' publish/wwwroot/index.html
43+
44+
- name: Add .nojekyll
45+
run: touch publish/wwwroot/.nojekyll
46+
47+
- name: Setup Pages
48+
uses: actions/configure-pages@v5
49+
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: publish/wwwroot
54+
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4
Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
[21:04:18.088] [T4] Init() started
2-
[21:04:18.091] [T4] Discovering projects...
3-
[21:04:18.138] [T4] Found 3 projects
4-
[21:04:18.139] [T4] Publishing SpawnDev.RTC.Demo...
5-
[21:04:18.140] [T4] RunDotnetAsync: dotnet publish (timeout=300s)
6-
[21:04:18.144] [T4] RunDotnetAsync: started PID=39636
7-
[21:04:31.946] [T13,pool] RunDotnetAsync: done PID=39636 exit=0
8-
[21:04:31.947] [T13,pool] Publish SpawnDev.RTC.Demo: exit=0
9-
[21:04:31.948] [T13,pool] Installing Playwright browsers...
10-
[21:04:32.608] [T13,pool] Creating Playwright instance...
11-
[21:04:32.971] [T17,pool] Launching Chromium (persistent profile: C:\Users\TJ\AppData\Local\Temp\SpawnDev.RTC.PlaywrightProfile)...
12-
[21:04:33.519] [T18,pool] Navigating to https://localhost:5570/tests...
13-
[21:04:33.955] [T13,pool] Page loaded, waiting for test table...
14-
[21:04:34.514] [T21,pool] Test table ready
15-
[21:04:34.852] [T10,pool] Browser tests enumerated: 100 tests
16-
[21:04:34.853] [T10,pool] Publishing SpawnDev.RTC.DemoConsole...
17-
[21:04:34.854] [T10,pool] RunDotnetAsync: dotnet publish (timeout=300s)
18-
[21:04:34.857] [T10,pool] RunDotnetAsync: started PID=36236
19-
[21:04:36.969] [T10,pool] RunDotnetAsync: done PID=36236 exit=0
20-
[21:04:36.970] [T10,pool] Publish SpawnDev.RTC.DemoConsole: exit=0
21-
[21:04:36.970] [T10,pool] Enumerating tests from SpawnDev.RTC.DemoConsole.exe...
22-
[21:04:37.081] [T21,pool] Enumeration done: exit=0, lines=99
23-
[21:04:37.082] [T21,pool] Init() complete. Total projects=2, total tests=200
24-
[21:06:32.905] [T23] [CrossPlatform] Signal room: wss://localhost:5570/signal/crossplatform-test-543439
25-
[21:06:35.422] [T19,pool] [CrossPlatform] Browser result: {browserResult}
26-
[21:06:35.427] [T29] [CrossPlatform] Desktop result: {desktopResultStr}
27-
[21:06:35.428] [T29] [CrossPlatform] SUCCESS - Desktop and browser exchanged data channel messages!
28-
[21:06:35.468] [T23] [Tracker Embedded] URL: wss://localhost:5570/announce, Room: embedded-test-033e05
29-
[21:06:37.502] [T25,pool] [Tracker Embedded] A connected
30-
[21:06:40.798] [T18,pool] [Tracker Embedded] B connected
31-
[21:06:41.116] [T18,pool] [Tracker Embedded] A peer: -SR0100-
32-
[21:06:41.117] [T25,pool] [Tracker Embedded] B peer: -SR0100-
33-
[21:06:41.118] [T29,pool] [Tracker Embedded] A peer: -SR0100-
34-
[21:06:41.118] [T31,pool] [Tracker Embedded] B peer: -SR0100-
35-
[21:06:41.119] [T29,pool] [Tracker Embedded] A got dc 'data' state=connecting
36-
[21:06:41.119] [T31,pool] [Tracker Embedded] B got dc 'data' state=connecting
37-
[21:06:41.319] [T37] [Tracker Embedded] A got dc 'data' state=open
38-
[21:06:41.334] [T36] [Tracker Embedded] B dc open
39-
[21:06:41.414] [T39] [Tracker Embedded] B got dc 'data' state=open
40-
[21:06:41.445] [T38] [Tracker Embedded] A dc open
41-
[21:06:41.619] [T13,pool] [Tracker Embedded] B sent
42-
[21:06:41.619] [T25,pool] [Tracker Embedded] A sent
43-
[21:06:41.635] [T39] [Tracker Embedded] B got: from A
44-
[21:06:41.635] [T37] [Tracker Embedded] A got: from B
45-
[21:06:41.636] [T37] [Tracker Embedded] A got: from B, B got: from A
46-
[21:06:41.679] [T23] [Tracker Live] Room: live-test-c308fc83
47-
[21:06:41.824] [T13,pool] [Tracker Embedded] A sent
48-
[21:06:41.919] [T29,pool] [Tracker Embedded] B sent
49-
[21:06:41.949] [T29,pool] [Tracker Live] A connected to openwebtorrent
50-
[21:06:44.466] [T25,pool] [Tracker Live] B connected to openwebtorrent
51-
[21:06:44.863] [T29,pool] [Tracker Live] A peer: -SR0100-
52-
[21:06:44.972] [T29,pool] [Tracker Live] B peer: -SR0100-
53-
[21:06:44.973] [T29,pool] [Tracker Live] B got dc 'data' state=connecting
54-
[21:06:45.261] [T40] [Tracker Live] A got dc 'data' state=open
55-
[21:06:45.293] [T42] [Tracker Live] B dc open
56-
[21:06:45.483] [T31,pool] [Tracker Live] B sent
57-
[21:06:45.515] [T40] [Tracker Live] A got: live B
58-
[21:06:45.770] [T31,pool] [Tracker Live] A sent
59-
[21:06:45.802] [T42] [Tracker Live] B got: live A
60-
[21:06:45.802] [T42] [Tracker Live] SUCCESS - A got: live B, B got: live A
61-
[21:06:45.846] [T23] [Tracker XPlat] URL: wss://localhost:5570/announce, Room: xplat-tracker-5cc106
62-
[21:06:47.892] [T31,pool] [Tracker XPlat] Desktop connected
63-
[21:06:49.198] [T31,pool] [Tracker XPlat] Desktop peer: -BR0100-
64-
[21:06:49.198] [T31,pool] [Tracker XPlat] Desktop peer: -BR0100-
65-
[21:06:49.277] [T43] [Tracker XPlat] Desktop got: from browser
66-
[21:06:49.704] [T18,pool] [Tracker XPlat] Desktop sent
67-
[21:06:49.783] [T31,pool] [Tracker XPlat] Desktop sent
68-
[21:06:49.784] [T18,pool] [Tracker XPlat] Browser result: OK:from desktop
69-
[21:06:49.784] [T18,pool] [Tracker XPlat] Desktop result: OK:from browser
70-
[21:06:49.784] [T18,pool] [Tracker XPlat] SUCCESS - Browser and desktop exchanged messages via WebTorrent tracker!
1+
[21:21:45.685] [T4] Init() started
2+
[21:21:45.688] [T4] Discovering projects...
3+
[21:21:45.737] [T4] Found 3 projects
4+
[21:21:45.739] [T4] Publishing SpawnDev.RTC.Demo...
5+
[21:21:45.740] [T4] RunDotnetAsync: dotnet publish (timeout=300s)
6+
[21:21:45.744] [T4] RunDotnetAsync: started PID=18524
7+
[21:22:01.752] [T10,pool] RunDotnetAsync: done PID=18524 exit=0
8+
[21:22:01.753] [T10,pool] Publish SpawnDev.RTC.Demo: exit=0
9+
[21:22:01.753] [T10,pool] Installing Playwright browsers...
10+
[21:22:02.217] [T10,pool] Creating Playwright instance...
11+
[21:22:02.585] [T16,pool] Launching Chromium (persistent profile: C:\Users\TJ\AppData\Local\Temp\SpawnDev.RTC.PlaywrightProfile)...
12+
[21:22:03.002] [T16,pool] Navigating to https://localhost:5570/tests...
13+
[21:22:03.431] [T16,pool] Page loaded, waiting for test table...
14+
[21:22:04.001] [T13,pool] Test table ready
15+
[21:22:04.400] [T21,pool] Browser tests enumerated: 100 tests
16+
[21:22:04.401] [T21,pool] Publishing SpawnDev.RTC.DemoConsole...
17+
[21:22:04.402] [T21,pool] RunDotnetAsync: dotnet publish (timeout=300s)
18+
[21:22:04.405] [T21,pool] RunDotnetAsync: started PID=24264
19+
[21:22:06.619] [T21,pool] RunDotnetAsync: done PID=24264 exit=0
20+
[21:22:06.620] [T21,pool] Publish SpawnDev.RTC.DemoConsole: exit=0
21+
[21:22:06.621] [T21,pool] Enumerating tests from SpawnDev.RTC.DemoConsole.exe...
22+
[21:22:06.733] [T15,pool] Enumeration done: exit=0, lines=99
23+
[21:22:06.734] [T15,pool] Init() complete. Total projects=2, total tests=200
24+
[21:24:04.310] [T25] [CrossPlatform] Signal room: wss://localhost:5570/signal/crossplatform-test-4da3b8
25+
[21:24:06.834] [T28,pool] [CrossPlatform] Browser result: {browserResult}
26+
[21:24:06.840] [T30] [CrossPlatform] Desktop result: {desktopResultStr}
27+
[21:24:06.841] [T30] [CrossPlatform] SUCCESS - Desktop and browser exchanged data channel messages!
28+
[21:24:06.880] [T25] [Tracker Embedded] URL: wss://localhost:5570/announce, Room: embedded-test-c607ab
29+
[21:24:08.927] [T21,pool] [Tracker Embedded] A connected
30+
[21:24:12.251] [T21,pool] [Tracker Embedded] B connected
31+
[21:24:12.605] [T13,pool] [Tracker Embedded] B peer: -SR0100-
32+
[21:24:12.608] [T21,pool] [Tracker Embedded] A peer: -SR0100-
33+
[21:24:12.609] [T21,pool] [Tracker Embedded] A peer: -SR0100-
34+
[21:24:12.609] [T18,pool] [Tracker Embedded] B peer: -SR0100-
35+
[21:24:12.610] [T21,pool] [Tracker Embedded] A got dc 'data' state=connecting
36+
[21:24:12.610] [T18,pool] [Tracker Embedded] B got dc 'data' state=connecting
37+
[21:24:12.847] [T35] [Tracker Embedded] A got dc 'data' state=open
38+
[21:24:12.880] [T30] [Tracker Embedded] B dc open
39+
[21:24:12.911] [T37] [Tracker Embedded] B got dc 'data' state=open
40+
[21:24:12.942] [T36] [Tracker Embedded] A dc open
41+
[21:24:13.116] [T21,pool] [Tracker Embedded] B sent
42+
[21:24:13.116] [T32,pool] [Tracker Embedded] A sent
43+
[21:24:13.131] [T35] [Tracker Embedded] A got: from B
44+
[21:24:13.131] [T37] [Tracker Embedded] B got: from A
45+
[21:24:13.132] [T37] [Tracker Embedded] A got: from B, B got: from A
46+
[21:24:13.175] [T25] [Tracker Live] Room: live-test-15cb816e
47+
[21:24:13.353] [T18,pool] [Tracker Embedded] A sent
48+
[21:24:13.417] [T18,pool] [Tracker Embedded] B sent
49+
[21:24:13.447] [T21,pool] [Tracker Live] A connected to openwebtorrent
50+
[21:24:15.960] [T27,pool] [Tracker Live] B connected to openwebtorrent
51+
[21:24:16.387] [T27,pool] [Tracker Live] A peer: -SR0100-
52+
[21:24:16.495] [T21,pool] [Tracker Live] B peer: -SR0100-
53+
[21:24:16.496] [T21,pool] [Tracker Live] B got dc 'data' state=connecting
54+
[21:24:16.771] [T36] [Tracker Live] A got dc 'data' state=open
55+
[21:24:16.803] [T39] [Tracker Live] B dc open
56+
[21:24:17.010] [T28,pool] [Tracker Live] B sent
57+
[21:24:17.025] [T36] [Tracker Live] A got: live B
58+
[21:24:17.279] [T28,pool] [Tracker Live] A sent
59+
[21:24:17.311] [T39] [Tracker Live] B got: live A
60+
[21:24:17.312] [T39] [Tracker Live] SUCCESS - A got: live B, B got: live A
61+
[21:24:17.355] [T25] [Tracker XPlat] URL: wss://localhost:5570/announce, Room: xplat-tracker-bda25d
62+
[21:24:19.390] [T28,pool] [Tracker XPlat] Desktop connected
63+
[21:24:20.710] [T32,pool] [Tracker XPlat] Desktop peer: -BR0100-
64+
[21:24:20.711] [T32,pool] [Tracker XPlat] Desktop peer: -BR0100-
65+
[21:24:20.797] [T30] [Tracker XPlat] Desktop got: from browser
66+
[21:24:21.223] [T18,pool] [Tracker XPlat] Desktop sent
67+
[21:24:21.301] [T13,pool] [Tracker XPlat] Desktop sent
68+
[21:24:21.303] [T32,pool] [Tracker XPlat] Browser result: OK:from desktop
69+
[21:24:21.303] [T32,pool] [Tracker XPlat] Desktop result: OK:from browser
70+
[21:24:21.304] [T32,pool] [Tracker XPlat] SUCCESS - Browser and desktop exchanged messages via WebTorrent tracker!

SpawnDev.RTC.Demo/wwwroot/404.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>SpawnDev.RTC</title>
6+
<script>
7+
// GitHub Pages SPA redirect - routes all paths back to index.html
8+
// so Blazor's client-side router can handle them
9+
var pathSegmentsToKeep = 1; // /SpawnDev.RTC/
10+
var l = window.location;
11+
l.replace(
12+
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
13+
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
14+
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
15+
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
16+
l.hash
17+
);
18+
</script>
19+
</head>
20+
<body>
21+
</body>
22+
</html>

0 commit comments

Comments
 (0)