-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.82 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
60
61
name: Docs
on:
push:
branches:
- master
workflow_dispatch:
jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"
- name: Setup Mono
run: |
sudo apt install -y gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install -y mono-runtime mono-devel msbuild
- name: Setup DocFX
working-directory: docs
run: |
mkdir docfx-bin && cd docfx-bin
wget https://github.com/dotnet/docfx/releases/download/v2.59.2/docfx.zip
7z x docfx.zip
- name: Run DocFX
env:
DOCFX_SOURCE_BRANCH_NAME: master
working-directory: docs/docfx
run: |
mono ../docfx-bin/docfx.exe docfx.json
- name: Commit Files
working-directory: docs/docfx/_site
run: |
COMMIT_ID="$(git rev-parse --short HEAD)"
git init
git add .
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "CI: Deploy DocFX" -m "Generated for $COMMIT_ID"
- name: Push to 'gh-pages' Branch
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: docs/docfx/_site
force: true
branch: refs/heads/gh-pages