Skip to content

Commit

Permalink
Edit GH Action to publish doc on release (#2392)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Apr 1, 2022
1 parent f349b48 commit 5fe0740
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
release:
types: [published]

jobs:
docs:
Expand All @@ -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
Expand Down

0 comments on commit 5fe0740

Please sign in to comment.