Skip to content

Commit 1ca98a2

Browse files
authored
Create ci-docs.yml
1 parent ac62e14 commit 1ca98a2

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/ci-docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: ci-docs
2+
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: main
8+
9+
jobs:
10+
build:
11+
runs-on: windows-2022
12+
steps:
13+
- name: Checkout
14+
uses: actions/[email protected]
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '8.0.x'
20+
21+
- name: Install DocFX
22+
run: dotnet tool update -g docfx
23+
24+
- name: Add DocFX to PATH
25+
run: echo "${HOME}/.dotnet/tools" >> $GITHUB_PATH
26+
27+
- name: Build documentation
28+
run: docfx docs/docfx.json
29+
30+
- name: Publish Documentation
31+
env:
32+
ACCESS_TOKEN: ${{ secrets.PAT_DOCS }}
33+
BRANCH: gh-pages
34+
DOCSFOLDER: artifacts/_site
35+
shell: cmd
36+
run: |
37+
cd %DOCSFOLDER%
38+
git init
39+
git config --local user.name "%GITHUB_ACTOR%"
40+
git config --local user.email "%GITHUB_ACTOR%@users.noreply.github.com"
41+
git config --local core.autocrlf false
42+
git add .
43+
git commit -m "docs update from commit %GITHUB_SHA%"
44+
git push --force https://%ACCESS_TOKEN%@github.com/%GITHUB_REPOSITORY%.git master:%BRANCH%
45+
rmdir .git /S /Q

0 commit comments

Comments
 (0)