-
Notifications
You must be signed in to change notification settings - Fork 133
184 lines (155 loc) · 5.23 KB
/
publish-docs.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Build Documentation
on:
workflow_dispatch:
pull_request:
env:
INSTANCE: Writerside/hi
ARTIFACT: webHelpHI2-all.zip
DOCKER_VERSION: '242.21870'
ALGOLIA_ARTIFACT: algolia-indexes-HI.zip
ALGOLIA_APP_NAME: JPTUGJLEMP
ALGOLIA_INDEX_NAME: PathPlanner_docs
ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }}
CONFIG_JSON_PRODUCT: HI
CONFIG_JSON_VERSION: 2025
jobs:
build-docs:
name: "[Docs] Build Writerside"
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}
- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7
- name: Upload algolia-indexes
uses: actions/upload-artifact@v4
with:
name: algolia-indexes
path: artifacts/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 7
test-docs:
name: "[Docs] Test Writerside"
runs-on: ubuntu-22.04
needs: build-docs
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: docs
path: artifacts
- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
build-api:
name: "[Docs] Build API Docs"
runs-on: ubuntu-22.04
needs: test-docs
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
- name: Build PathPlannerLib
working-directory: pathplannerlib
run: |
./gradlew build
./gradlew publish
- name: Get Doxygen theme
working-directory: pathplannerlib
run: |
git submodule add https://github.com/jothepro/doxygen-awesome-css.git
cd doxygen-awesome-css
git checkout v2.2.1
- name: Generate Doxygen docs
uses: mattnotmitt/[email protected]
with:
working-directory: pathplannerlib
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install python dependencies
working-directory: ./pathplannerlib-python
run: |
python -m pip install --upgrade pip
pip install build handsdown mkdocs mkdocs-material
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Generate python docs
working-directory: ./pathplannerlib-python
run: |
handsdown --external https://github.com/mjansen4857/pathplanner.git -o docsmd -n pathplannerlib --source-code-path pathplannerlib-python --theme=material --create-configs include pathplannerlib
python -m mkdocs build
- name: Move docs to api dir
run: |
mkdir _site
mkdir _site/api
sudo mv pathplannerlib/build/docs/javadoc _site/api/java
sudo mv pathplannerlib/build/docs/cpp/html _site/api/cpp
sudo mv pathplannerlib-python/docs _site/api/python
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs
- name: Unzip docs artifact
run: unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d _site
- name: Fix permissions
run: |
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
deploy-pages:
name: "[Docs] Deploy GitHub Pages"
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' }}
needs: build-api
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
publish-indexes:
name: "[Docs] Publish Search Indexes"
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' }}
needs: test-docs
container:
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: algolia-indexes
- name: Unzip artifact
run: |
unzip -O UTF-8 -qq ${{ env.ALGOLIA_ARTIFACT }} -d algolia-indexes
env "algolia-key=${{env.ALGOLIA_KEY}}" java -jar /opt/builder/help-publication-agent.jar \
update-index \
--application-name ${{env.ALGOLIA_APP_NAME}} \
--index-name ${{env.ALGOLIA_INDEX_NAME}} \
--product ${{env.CONFIG_JSON_PRODUCT}} \
--version ${{env.CONFIG_JSON_VERSION}} \
--index-directory algolia-indexes/ \
2>&1 | tee algolia-update-index-log.txt