File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Deploy pages
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ build-site :
8+ runs-on : windows-latest
9+ steps :
10+ - name : Checkout branch
11+ uses : actions/checkout@v3
12+
13+ - name : Check status
14+ run : git status
15+
16+ - name : Download docfx
17+ run : curl https://github.com/dotnet/docfx/releases/download/v2.59.2/docfx.zip -L -o ../docfx.zip
18+
19+ - name : Expand docfx
20+ run : Expand-Archive ../docfx.zip -DestinationPath ../docfx
21+
22+ - name : Build site with docfx
23+ run : ../docfx/docfx.exe build docfx.json --warningsAsErrors
24+
25+ - name : Archive site
26+ run : Compress-Archive -Path _site/* -DestinationPath ${{ runner.temp }}/site.zip
27+
28+ - name : Upload artifact
29+ uses : actions/upload-artifact@v3
30+ with :
31+ name : github-pages
32+ path : ${{ runner.temp }}/site.zip
33+
34+ publish-pages :
35+ needs : build-site
36+ runs-on : windows-latest
37+ steps :
38+ - name : Checkout branch
39+ uses : actions/checkout@v3
40+ with :
41+ ref : gh-pages
42+ - name : Download artifacts
43+ uses : actions/download-artifact@v3
44+ with :
45+ name : github-pages
46+ path : ../
47+ - name : Clear directory
48+ run : Get-ChildItem . -Recurse | Remove-Item -Force -Recurse
49+ - name : Extract archive
50+ run : Expand-Archive -Path ../site.zip -DestinationPath .
51+ - name : Push changes to gh-pages
52+ run : |
53+ git config user.name github-actions
54+ git config user.email [email protected] 55+ git add .
56+ git commit -m "Pages update"
57+ git push
You can’t perform that action at this time.
0 commit comments