workflows: build docs if theres any changes in docs directory

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2024-03-23 19:09:37 +07:00
parent 5de44baff4
commit ed19fee93d
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
2 changed files with 19 additions and 1 deletions

18
.github/workflows/build-docs-dir.yml vendored Normal file
View file

@ -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 }}

View file

@ -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"