File tree Expand file tree Collapse file tree 2 files changed +4617
-9
lines changed
Expand file tree Collapse file tree 2 files changed +4617
-9
lines changed Original file line number Diff line number Diff line change @@ -2,35 +2,49 @@ name: update gh-pages branch
22
33on :
44 workflow_dispatch :
5-
5+
66jobs :
7- build-site :
7+ build-site :
88 runs-on : windows-latest
99 steps :
1010 - name : Checkout branch
1111 uses : actions/checkout@v4
12-
12+
1313 - name : Check status
1414 run : git status
15-
15+
1616 - name : Download docfx
1717 run : curl https://github.com/dotnet/docfx/releases/download/v2.77.0/docfx-win-x64-v2.77.0.zip -L -o ../docfx-win-x64-v2.77.0.zip
18-
18+
1919 - name : Expand docfx
2020 run : Expand-Archive ../docfx-win-x64-v2.77.0.zip -DestinationPath ../docfx
21-
21+
22+ - name : Create redirect files from redirects.json
23+ run : |
24+ $json = Get-Content redirects.json -Raw | ConvertFrom-Json
25+ foreach ($item in $json) {
26+ $file = $item.file
27+ $targethref = $item.targethref
28+ $dirPath = Split-Path -Path $file -Parent
29+ if ($dirPath -and -not (Test-Path $dirPath)) {
30+ New-Item -ItemType Directory -Path $dirPath -Force | Out-Null
31+ }
32+ $content = "---`nredirect_url: $targethref`n---`n"
33+ Set-Content -Path $file -Value $content -Force
34+ }
35+
2236 - name : Build site with docfx
2337 run : " ../docfx/docfx.exe build docfx.json -m _matomoContainerUrl=\" https://matomo.devexpress.com/js/container_kE7MWPi0.js\" --warningsAsErrors"
24-
38+
2539 - name : Archive site
2640 run : Compress-Archive -Path _site/* -DestinationPath ${{ runner.temp }}/site.zip
27-
41+
2842 - name : Upload artifact
2943 uses : actions/upload-artifact@v4
3044 with :
3145 name : github-pages
3246 path : ${{ runner.temp }}/site.zip
33-
47+
3448 publish-pages :
3549 needs : build-site
3650 runs-on : windows-latest
You can’t perform that action at this time.
0 commit comments