Skip to content

Commit

Permalink
Pyrofork: docs: Add versioning
Browse files Browse the repository at this point in the history
Signed-off-by: wulan17 <wulan17@nusantararom.org>
  • Loading branch information
wulan17 committed Dec 30, 2023
1 parent d2059ce commit eb3a1b4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Build-docs

on:
push:
tags:
- '*'
branches:
- main
- staging

jobs:
build:
Expand Down
12 changes: 10 additions & 2 deletions build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ 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
cp -r ../docs/build/html/* .
if ["$GITHUB_REF" = "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
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
Expand Down
7 changes: 6 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@
"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"
Expand Down

0 comments on commit eb3a1b4

Please sign in to comment.