-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (64 loc) · 2.09 KB
/
Copy pathdocfx.yml
File metadata and controls
80 lines (64 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Build and publish multiple docfx projects to GitHub Pages
on:
push:
branches:
- master
# Set permissions to allow deployment to GitHub Pages
permissions:
actions: read
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
lfs: true
token: ${{ secrets.PAT_TOKEN }}
- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- name: Install docfx globally
run: dotnet tool install -g docfx
- name: Build documentation for each submodule
run: |
# Create a directory to store all generated sites
mkdir -p build
# Find all submodules (assumes they are in the root directory)
for submodule in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do
echo "Building documentation for $submodule"
# Navigate into the submodule directory
cd $submodule
# Ensure we are on the correct branch and pull the latest changes
git checkout master
git pull origin master
git lfs pull
# Run docfx build command (assumes docfx.json is in the docs folder)
docfx docs/docfx.json
# Copy the generated site to the build directory under a subfolder
cp -r docs/_site ../build/$submodule
# Navigate back to the main repo directory
cd ..
done
- name: Copy the index.html file
run: |
# Copy the static index.html file to the root of the build directory
cp index.html build/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'build' # Upload the aggregated documentation
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4