From 5fe0740268020e3fde7921b9e1d792dac0bd1e9b Mon Sep 17 00:00:00 2001 From: Vadim Mishenev Date: Tue, 22 Mar 2022 16:23:39 +0300 Subject: [PATCH] Edit GH Action to publish doc on release (#2392) --- .github/workflows/gh-pages.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index a221dcfa979..c444a3e49b1 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -4,6 +4,8 @@ on: push: branches: - master + release: + types: [published] jobs: docs: @@ -30,17 +32,17 @@ jobs: - name: Get current dokka version run: echo "DOKKA_VERSION=`./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2 | cut -d '-' -f 1`" >> $GITHUB_ENV - if: steps.filter.outputs.docs_changed == 'true' + if: github.event_name == 'release' || steps.filter.outputs.docs_changed == 'true' working-directory: ./dokka - name: Build docs run: ./gradlew mkdocsBuild -Pdokka_version=$DOKKA_VERSION --info - if: steps.filter.outputs.docs_changed == 'true' + if: github.event_name == 'release' || steps.filter.outputs.docs_changed == 'true' working-directory: ./dokka - name: Deploy uses: peaceiris/actions-gh-pages@v3 - if: steps.filter.outputs.docs_changed == 'true' + if: github.event_name == 'release' || steps.filter.outputs.docs_changed == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dokka/docs/build/mkdocs