From e7c71922339bb44a631d9739e5db279947c01d03 Mon Sep 17 00:00:00 2001 From: wulan17 Date: Sat, 30 Dec 2023 23:53:55 +0700 Subject: [PATCH] Pyrofork: workflows: build main branch docs only on new tags Signed-off-by: wulan17 --- .github/workflows/build-docs.yml | 3 ++- build-docs.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index b98b45151..1c8227992 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -2,8 +2,9 @@ name: Build-docs on: push: + tags: + - "*" branches: - - main - staging jobs: diff --git a/build-docs.sh b/build-docs.sh index ce3db380c..26c6196eb 100644 --- a/build-docs.sh +++ b/build-docs.sh @@ -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