Skip to content

Commit ee0424b

Browse files
claudejonfuller
authored andcommitted
Add GitHub Actions deploy workflow for WASM → htmltools
Automatically publishes HealthNerd.Wasm to jonfuller/htmltools at /healthnerd/ on every push to master that touches the WASM project. Setup required before merge: 1. Create a GitHub PAT with repo scope on jonfuller/htmltools 2. Add it as secret HTMLTOOLS_DEPLOY_TOKEN on jonfuller/HealthNerd 3. Merge this PR — first deploy runs automatically Also: - Sets <base href="/healthnerd/" /> in index.html for correct subpath - Adds .nojekyll so GitHub Pages serves _framework/ files correctly Trigger manually via Actions → "Deploy HealthNerd WASM" → Run workflow https://claude.ai/code/session_01GwHuC47PH81Zw3EUfgkrYN
1 parent 4e6d952 commit ee0424b

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

.github/workflows/deploy-wasm.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy HealthNerd WASM
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'src/HealthNerd.Wasm/**'
8+
- '.github/workflows/deploy-wasm.yml'
9+
workflow_dispatch: # allow manual trigger from GitHub Actions UI
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout HealthNerd
17+
uses: actions/checkout@v4
18+
19+
- name: Setup .NET 8
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: '8.0.x'
23+
24+
- name: Publish Blazor WASM
25+
run: dotnet publish src/HealthNerd.Wasm/HealthNerd.Wasm.csproj -c Release -o ./publish
26+
27+
- name: Checkout htmltools
28+
uses: actions/checkout@v4
29+
with:
30+
repository: jonfuller/htmltools
31+
token: ${{ secrets.HTMLTOOLS_DEPLOY_TOKEN }}
32+
path: htmltools
33+
34+
- name: Copy WASM output to htmltools/healthnerd
35+
run: |
36+
rm -rf htmltools/healthnerd
37+
mkdir -p htmltools/healthnerd
38+
cp -r ./publish/wwwroot/. htmltools/healthnerd/
39+
# Ensure Jekyll ignores _framework/ files
40+
touch htmltools/.nojekyll
41+
42+
- name: Commit and push to htmltools
43+
run: |
44+
cd htmltools
45+
git config user.email "github-actions[bot]@users.noreply.github.com"
46+
git config user.name "github-actions[bot]"
47+
git add -A
48+
git diff --staged --quiet && echo "No changes to deploy" && exit 0
49+
git commit -m "Deploy HealthNerd WASM from HealthNerd@${{ github.sha }}"
50+
git push

src/HealthNerd.Wasm/wwwroot/.nojekyll

Whitespace-only changes.

src/HealthNerd.Wasm/wwwroot/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>HealthNerd</title>
7-
<base href="/" />
7+
<base href="/healthnerd/" />
88
<link rel="stylesheet" href="css/app.css" />
99
</head>
1010
<body>

0 commit comments

Comments
 (0)