Skip to content

Commit 1453fdf

Browse files
rename file
1 parent b56a352 commit 1453fdf

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: update gh-pages branch
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

0 commit comments

Comments
 (0)