-
Notifications
You must be signed in to change notification settings - Fork 121
48 lines (39 loc) · 1.37 KB
/
ghpages.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
name: Publish Documentation
on:
push:
branches:
- main
jobs:
build:
runs-on: windows-latest
steps:
- name: Clone Repo
uses: actions/checkout@v1
- name: Download DocFX
run: |
mkdir .tools/docfx
Invoke-WebRequest -Uri "https://github.com/dotnet/docfx/releases/download/v${env:DOCFXVERSION}/docfx.zip" -OutFile ".tools/docfx/docfx.zip"
[System.IO.Compression.ZipFile]::ExtractToDirectory(".tools/docfx/docfx.zip", ".tools/docfx" )
env:
DOCFXVERSION: 2.59.4
- name: Build Documentation
env:
DOCFX_SOURCE_BRANCH_NAME: main
run: |
.tools/docfx/docfx.exe docs/docfx.json
powershell -ExecutionPolicy ByPass -command "docs\FixApiRefLinks" -Path output\docs_site\api\
- name: Publish Documentation
env:
ACCESS_TOKEN: ${{ secrets.GH_PAT }}
BRANCH: gh-pages
shell: cmd
run: |
cd output\docs_site
git init
git config --local user.name "%GITHUB_ACTOR%"
git config --local user.email "%GITHUB_ACTOR%@users.noreply.github.com"
git config --local core.autocrlf false
git add .
git commit -m "Auto-update doc from commit %GITHUB_SHA%"
git push --force https://%ACCESS_TOKEN%@github.com/%GITHUB_REPOSITORY%.git master:%BRANCH%
rmdir .git /S /Q