Skip to content

Commit 87b3258

Browse files
committed
ci: write versions.json
1 parent ec358e3 commit 87b3258

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,19 @@ jobs:
169169
cp -r artifacts/$version docs/
170170
fi
171171
172+
- name: Generate versions.json
173+
run: |
174+
echo "[]" > docs/versions.json
175+
for version in docs/*; do
176+
if [ -d "docs/$version" ]; then
177+
aliases="[]"
178+
if [ "$version" == "master" ]; then
179+
aliases="[\"latest\"]"
180+
fi
181+
jq --arg version ${version} --argjson aliases ${aliases} '. + [{"version": "/en/$version", "title": "$version", "aliases": $aliases}]' docs/versions.json > docs/versions.json
182+
fi
183+
done
184+
172185
- name: 🚀 Commit & deploy
173186
uses: EndBug/add-and-commit@v9
174187
with:

0 commit comments

Comments
 (0)