Pyrofork: docs: Add versioning

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-12-30 21:15:39 +07:00
parent d2059ce948
commit 08283fe907
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
3 changed files with 20 additions and 5 deletions

View file

@ -2,8 +2,9 @@ name: Build-docs
on:
push:
tags:
- '*'
branches:
- main
- staging
jobs:
build:

View file

@ -12,8 +12,17 @@ cd ../..
"$VENV"/bin/sphinx-build -b html "docs/source" "docs/build/html" -j auto
git clone https://wulan17:"$DOCS_KEY"@github.com/Mayuri-Chan/pyrofork-docs.git
cd pyrofork-docs
rm -rf _includes api genindex.html intro py-modindex.html sitemap.xml support.html topics _static faq index.html objects.inv searchindex.js start telegram
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
rm -rf _includes api genindex.html intro py-modindex.html sitemap.xml support.html topics _static faq index.html objects.inv searchindex.js start telegram main
cp -r ../docs/build/html/* .
mkdir main
cp -r ../docs/build/html/* main/
else
mkdir -p staging
cd staging
rm -rf _includes api genindex.html intro py-modindex.html sitemap.xml support.html topics _static faq index.html objects.inv searchindex.js start telegram
cp -r ../../docs/build/html/* .
fi
git config --local user.name "Mayuri-Chan"
git config --local user.email "mayuri@mayuri.my.id"
git add --all

View file

@ -94,7 +94,12 @@ html_theme_options = {
"scheme": "slate"
}
],
"toc_title_is_page_title": True
"toc_title_is_page_title": True,
"version_dropdown": True,
"version_info": [
{"version": "main", "title": "main", "aliases": ["latest"]},
{"version": "staging", "title": "staging", "aliases": []},
],
}
html_logo = "../resources/static/img/pyrogram.png"