11name : Publish GH - Pages
2+ # Based on https://github.com/actions/starter-workflows/blob/main/pages/static.yml
23
4+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
35permissions :
46 contents : read
57 pages : write
8+ id-token : write
9+
10+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
11+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
12+ concurrency :
13+ group : " pages"
14+ cancel-in-progress : false
615
716on :
817 push :
9- branches : [ main, release/v2.2, release/v2.3 ]
10-
18+ branches : [ release/v2.3 ]
19+ # Allows you to run this workflow manually from the Actions tab
20+ workflow_dispatch :
1121jobs :
12- build :
13-
22+ deploy :
23+ environment :
24+ name : github-pages
25+ url : ${{ steps.deployment.outputs.page_url }}
1426 runs-on : windows-latest
1527
1628 steps :
17- - uses : actions/checkout@v2
29+ - uses : actions/checkout@v4
1830 with :
1931 fetch-depth : 0
20- - name : Set Docs Locations
21- id : branch
22- run : |
23- $branchName = "${{ github.ref }}"
24- # refs/heads/ is 11 characters
25- $branchName = $branchName.Substring(11)
26-
27- if($branchName.StartsWith("release/"))
28- {
29- $branchName = $branchName.Substring(8)
30- }
31- elseif ($branchName -eq "main")
32- {
33- $branchName = ""
34- }
35- echo "::set-output name=DOCS_LOCATION::$branchName"
3632 - name : Setup .NET Core
3733 uses : actions/setup-dotnet@v1
3834 with :
@@ -43,11 +39,13 @@ jobs:
4339 run : choco install docfx
4440 - name : Run DocFx
4541 run : docfx docfx/docfx.json
46- - name : Upload to GitHub Pages
47- 42+ - name : Setup Pages
43+ uses : actions/configure-pages@v4
44+ - name : Upload artifact
45+ uses : actions/upload-pages-artifact@v3
4846 with :
49- github_token : ${{ secrets.GITHUB_TOKEN }}
50- publish_dir : docfx/_site
51- destination_dir : ${{ steps.branch.outputs.DOCS_LOCATION }}
52- keep_files : true
53- full_commit_message : Deploy ${{ steps.branch.outputs.DOCS_LOCATION }} to GitHub Pages
47+ # Upload build docfx site
48+ path : ' docfx/_site'
49+ - name : Deploy to GitHub Pages
50+ id : deployment
51+ uses : actions/deploy-pages@v4
0 commit comments