1
1
name : Publish GH - Pages
2
+ # Based on https://github.com/actions/starter-workflows/blob/main/pages/static.yml
2
3
4
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
3
5
permissions :
4
6
contents : read
5
7
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
6
15
7
16
on :
8
17
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 :
11
21
jobs :
12
- build :
13
-
22
+ deploy :
23
+ environment :
24
+ name : github-pages
25
+ url : ${{ steps.deployment.outputs.page_url }}
14
26
runs-on : windows-latest
15
27
16
28
steps :
17
- - uses : actions/checkout@v2
29
+ - uses : actions/checkout@v4
18
30
with :
19
31
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"
36
32
- name : Setup .NET Core
37
33
uses : actions/setup-dotnet@v1
38
34
with :
@@ -43,11 +39,13 @@ jobs:
43
39
run : choco install docfx
44
40
- name : Run DocFx
45
41
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
48
46
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