Skip to content

Commit 096a412

Browse files
authored
Add GitHub Actions workflow for publishing docs
This workflow automates the publishing of documentation to GitHub Pages upon pushes to the main branch.
1 parent a9a681d commit 096a412

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/publish-docs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Your GitHub workflow file under .github/workflows/
2+
# Trigger the action on push to main
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
actions: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
publish-docs:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Dotnet Setup
30+
uses: actions/setup-dotnet@v3
31+
with:
32+
dotnet-version: 8.x
33+
34+
- run: dotnet tool update -g docfx
35+
- run: docfx docs/docfx.json
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
# Upload entire repository
41+
path: '<docfx-project-path>/_site'
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)