Pyrofork: workflows: build main branch docs only on new tags

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-12-30 23:53:55 +07:00
parent 53562e4354
commit b06da1ecdc
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
2 changed files with 4 additions and 2 deletions

View file

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

View file

@ -12,7 +12,8 @@ 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
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
refs=$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")
if [[ "$refs" == "refs/tags" ]]; then
mkdir -p main
cd main
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