@@ -137,7 +137,7 @@ jobs:
137
137
138
138
- name : Add files to bypass nojekyll
139
139
run : |
140
- touch _build/${{ needs.sphinx_docs.outputs.version-name }}/API/ .nojekyll
140
+ touch _build/${{ needs.sphinx_docs.outputs.version-name }}/.nojekyll
141
141
142
142
# Deploy files contain in _build directory on gh-pages branch
143
143
- name : deploy-doc
@@ -167,19 +167,28 @@ jobs:
167
167
- name : Write versions to JSON file
168
168
run : |
169
169
rm -f versions.json
170
- echo '[' > versions.json
170
+ echo '[' >versions.json
171
171
PREFIX=''
172
- for version in $(ls -d */); do
173
- echo -n "$PREFIX" >> versions.json
172
+ for version in $(ls -d */ | sort -n ); do
173
+ echo -n "$PREFIX" >>versions.json
174
174
PREFIX=','
175
- echo -n '{"url": "/alt-ergo/'$version'", "slug": "'${version%/}'"}' >> versions.json
175
+ echo -n '{"url": "/alt-ergo/'$version'", "slug": "'${version%/}'"}' >>versions.json
176
+ done
177
+ echo -n ']' >>versions.json
178
+
179
+ - name : Write versions to index.md
180
+ run : |
181
+ rm -f index.md
182
+ echo '# Alt-Ergo' >index.md
183
+ echo 'Select the documentation for your version:' >>index.md
184
+ for version in $(ls -d */ | sort -n); do
185
+ echo " - [${version%/]($version)" >>index.md
176
186
done
177
- echo -n ']' >> versions.json
178
187
179
188
- name : Push new versions
180
189
run : |
181
190
git config user.name github-actions
182
191
git config user.email [email protected]
183
- git add versions.json
192
+ git add versions.json index.md
184
193
git commit -m 'Update versions.json' || exit 0
185
194
git push
0 commit comments