-
Notifications
You must be signed in to change notification settings - Fork 40
59 lines (49 loc) · 1.98 KB
/
docs.yml
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
name: Create Documentation Pages
on:
push:
branches:
- prod
- build-docs
jobs:
build_docs:
runs-on: ubuntu-latest
name: Builds documentation and publishes to GitHub Pages
steps:
# Checkout repo
- uses: actions/checkout@v3
name: Checkout repo
# Install NuGet
- uses: nuget/setup-nuget@v1
name: Install NuGet
# Install NuGet dependencies
- name: Install NuGet dependencies
run: nuget restore JotunnLib.sln
# Needed so csproj can load correctly, isn't actually used
- name: Set references to DLLs
run: |
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><Project ToolsVersion=\"Current\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"><PropertyGroup><VALHEIM_INSTALL>$HOME/VHINSTALL/</VALHEIM_INSTALL></PropertyGroup></Project>" > Environment.props
# Build docs
- uses: nunit/docfx-action@v2.6.0
name: Build documentation
with:
args: JotunnLib/docfx.json
# Build docs again so cref is resolved
- uses: nikeee/docfx-action@v1.0.0
name: Build documentation again with crefs
with:
args: JotunnLib/docfx.json
# Fix permissions on DocFX output (should not be owned by root!)
# See https://github.com/nikeee/docfx-action/issues/13
- name: Fix DocFX output permissions
run: |
sudo chown -R "$UID" JotunnLib/_site
# Patch broken docfx JavaScript that fails to parse query params for tabs
- name: Patch DocFX JavaScript bugs
run: |
sed -e "s/queryString = ''/queryString = location.search/" -i.orig JotunnLib/_site/styles/docfx.js
# Publish generated site using GitHub Pages
- uses: maxheld83/ghpages@master
name: Publish documentation to GitHub Pages
env:
BUILD_DIR: JotunnLib/_site # docfx's default output directory is _site
GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages