Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

Commit 672b93c

Browse files
committed
chore(ci): update GitHub Pages documentation workflow
Simplify and modernize the documentation deployment process. Replace separate build/deploy jobs with a single publish-docs job using the latest actions. Update actions/checkout to v4, actions/setup-dotnet to v4, and switch to actions/deploy-pages for deployment. Add proper permissions and concurrency settings for GitHub Pages.
1 parent f8711db commit 672b93c

File tree

1 file changed

+26
-38
lines changed

1 file changed

+26
-38
lines changed

.github/workflows/documentation.yml

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,44 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
817
jobs:
9-
# Build the documentation
10-
build:
11-
runs-on: windows-latest # Required by DocFX
18+
publish-docs:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
1223
steps:
1324
- name: Checkout
14-
uses: actions/checkout@v2
15-
# with:
16-
# submodules: true
25+
uses: actions/checkout@v4
1726

18-
- name: Dotnet Setup
19-
uses: actions/setup-dotnet@v3
27+
- name: Setup .NET
28+
uses: actions/setup-dotnet@v4
2029
with:
21-
dotnet-version: 8.x
30+
dotnet-version: 8.x
2231

23-
- name: Install docfx
32+
- name: Install DocFX
2433
run: dotnet tool update -g docfx
2534

2635
- name: Use README.md as index.md
27-
run: cp readme.md Documentation/index.md
36+
run: cp README.md Documentation/index.md
2837

2938
- name: Build
30-
run: docfx Documentation/docfx.json
39+
run: docfx Documentation/docfx.json
3140

32-
# Upload the generated documentation
33-
- name: Upload site artifact
41+
- name: Upload artifact
3442
uses: actions/upload-pages-artifact@v3
3543
with:
36-
name: _site
37-
path: _site # Must equals the 'build.dest' value on your docfx.json
38-
39-
# Deploy the generated documentation to the gh-pages branch
40-
deploy:
41-
needs: build
42-
runs-on: ubuntu-latest
43-
steps:
44-
- name: Checkout
45-
uses: actions/checkout@v2
46-
# with:
47-
# submodules: true
48-
49-
# Download the generated documentation
50-
- name: Download site artifact
51-
uses: actions/download-artifact@v1
52-
with:
53-
name: _site
44+
path: '_site'
5445

55-
- name: Deploy
56-
uses: peaceiris/actions-gh-pages@v3
57-
with:
58-
github_token: ${{ secrets.GITHUB_TOKEN }}
59-
publish_branch: gh-pages
60-
publish_dir: _site
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)