Skip to content

Commit 884c082

Browse files
committed
Create workflow for building and deploying DocFx generated API reference website on GitHub Pages
1 parent 4c66ca4 commit 884c082

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build & Deploy API Docs
2+
3+
on:
4+
push:
5+
branches: [ docs ]
6+
7+
permissions:
8+
actions: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: false
15+
16+
jobs:
17+
build:
18+
runs-on: windows-latest
19+
steps:
20+
# 1. Checkout current main branch into RichCanvas/
21+
- name: Checkout current branch
22+
uses: actions/checkout@v4
23+
24+
# 2. Checkout v2.4.2 into RichCanvas-2.4.2/
25+
- name: Checkout v2.4.2
26+
uses: actions/checkout@v4
27+
with:
28+
ref: v2.4.2
29+
path: RichCanvas-v2.4.2
30+
31+
# 3. Setup .NET (if your project needs it for metadata)
32+
- name: Setup .NET
33+
uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: '9.0.x'
36+
37+
# 4. Download DocFX
38+
- run: dotnet tool update -g docfx
39+
- name: DocFX Build
40+
working-directory: docs
41+
run: docfx docfx.json
42+
continue-on-error: false
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: 'docs/_site'
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

docs/docfx.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"outputFormat": "markdown",
1818
"src": [
1919
{
20-
"src": "../RichCanvas-v2.4.2",
20+
"src": "../RichCanvas-v2.4.2/RichCanvas",
2121
"files": [
2222
"**/*.csproj"
2323
]
@@ -53,4 +53,4 @@
5353
"pdf": false
5454
}
5555
}
56-
}
56+
}

0 commit comments

Comments
 (0)