Skip to content

deploy: Released v2.18.1 #109

deploy: Released v2.18.1

deploy: Released v2.18.1 #109

Workflow file for this run

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
- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
# Install NuGet
- uses: nuget/setup-nuget@v1
name: Install NuGet
# Install NuGet dependencies
- name: Install NuGet dependencies
run: nuget restore JotunnLib.sln
# Prepare Valheim dependencies
- name: Prepare Valheim dependencies
run: |
mkdir -p ~/VHINSTALL
wget -O bepinex.zip "https://valheim.thunderstore.io/package/download/denikson/BepInExPack_Valheim/5.4.2202/"
unzip bepinex.zip -d ~/BepInExRaw
mv ~/BepInExRaw/BepInExPack_Valheim/* ~/VHINSTALL/
# Needed so csproj can load correctly
- 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
- name: Install docfx
run: |
dotnet tool update -g docfx --version 2.70.0
# Build docs
- name: Build documentation
run: |
docfx JotunnLib/docfx.json
# Build docs again so cref is resolved
- name: Build documentation again with crefs
run: |
docfx 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
- name: Fix DocFX css
run: |
cp JotunnLib/_site/styles/docfx.vendor.min.css JotunnLib/_site/styles/docfx.vendor.css
# 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