From ed19fee93d35820c7c787edc6cd79595e659efbe Mon Sep 17 00:00:00 2001 From: wulan17 Date: Sat, 23 Mar 2024 19:09:37 +0700 Subject: [PATCH] workflows: build docs if theres any changes in docs directory Signed-off-by: wulan17 --- .github/workflows/build-docs-dir.yml | 18 ++++++++++++++++++ build-docs.sh | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-docs-dir.yml diff --git a/.github/workflows/build-docs-dir.yml b/.github/workflows/build-docs-dir.yml new file mode 100644 index 00000000..7170dd7b --- /dev/null +++ b/.github/workflows/build-docs-dir.yml @@ -0,0 +1,18 @@ +name: Build-docs + +on: + push: + paths: + - 'docs/**' + +jobs: + build: + + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: Build + run: bash build-docs.sh + env: + DOCS_KEY: ${{ secrets.DOCS_KEY }} diff --git a/build-docs.sh b/build-docs.sh index 6bdcf148..0f79435c 100644 --- a/build-docs.sh +++ b/build-docs.sh @@ -3,7 +3,7 @@ export DOCS_KEY VENV="$(pwd)"/venv export VENV -if [[ "$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")" == "refs/tags" ]]; then +if [[ "$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")" == "refs/tags" ]] || [[ "$GITHUB_REF" == "refs/heads/main" ]]; then branch="main" elif [[ "$GITHUB_REF" == "refs/heads/staging" ]]; then branch="staging"