-
Notifications
You must be signed in to change notification settings - Fork 145
54 lines (54 loc) · 1.89 KB
/
docfx.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
name: Refresh documentation
on:
push:
branches:
# Only update docs for dev branch pushes
- dev
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
docfx:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# prevent parallel executions
- name: Wait for actions to finish
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Checks-out dev branch
- name: Checkout dev branch
uses: actions/checkout@v2
with:
ref: dev
path: dev
# Checks-out gh-pages branch
- name: Checkout dev branch
uses: actions/checkout@v2
with:
ref: gh-pages
path: gh-pages
# Install docfx, stick with version 2.51 as higher versions result in https://github.com/dotnet/docfx/issues/5785 > fixed in 2.56.4+
- name: Install dependencies
run: |
wget https://github.com/dotnet/docfx/releases/download/v2.59.3/docfx.zip
sudo unzip docfx.zip -d /usr/local/lib/docfx
rm docfx.zip
echo '#!/bin/sh' | sudo tee -a /usr/local/bin/docfx > /dev/null
echo 'exec `which mono` $MONO_OPTIONS /usr/local/lib/docfx/docfx.exe "$@"' | sudo tee -a /usr/local/bin/docfx > /dev/null
sudo chmod +x /usr/local/bin/docfx
# Build docs
- name: Build docs
shell: pwsh
run: |
./dev/docs/build.ps1
# Add, commit and push the changes
- name: Add & Commit & Push
uses: EndBug/add-and-commit@v6
with:
# The directory where your repository is located. You should use actions/checkout first to set it up
cwd: ./gh-pages
branch: gh-pages
push: true
token: ${{ secrets.GITHUB_TOKEN }}