-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (47 loc) · 1.36 KB
/
generateDocsDev.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
name: GenerateDocsDev
on:
push:
branches:
- '**'
concurrency: documentation
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Setup environment
run: dotnet restore
- name: Setup tooling
run: |
dotnet tool install --global docfx
- name: Build documentation
run: docfx doc/docfx.json
- name: Extract branch name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Check out repo shadow copy
uses: actions/checkout@v3
with:
ref: gh-pages
path: docwrite
fetch-depth: 0
- name: Copy documentation over
run: |
rm -rf docwrite/${BRANCH_NAME}
cp -r doc/_site docwrite/${BRANCH_NAME}
- name: Check in
working-directory: docwrite
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git diff-index --quiet HEAD || git commit -a -m "Update ${BRANCH_NAME} documentation"
- name: Push changes
uses: ad-m/github-push-action@master
with:
directory: docwrite
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages