aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/gh-pages.yml
diff options
context:
space:
mode:
authorKamil Doległo <9080183+kamildoleglo@users.noreply.github.com>2020-10-07 11:46:56 +0200
committerGitHub <noreply@github.com>2020-10-07 11:46:56 +0200
commitde6019337ae0e97e73db7fa9394e88ec2de4aeed (patch)
tree2dfa086e16fc15b00b3c98ddaf79fcdf711ce8e4 /.github/workflows/gh-pages.yml
parentc2b741232c0dbf4e44dbb477b6a11fb836cf0c33 (diff)
downloaddokka-de6019337ae0e97e73db7fa9394e88ec2de4aeed.tar.gz
dokka-de6019337ae0e97e73db7fa9394e88ec2de4aeed.tar.bz2
dokka-de6019337ae0e97e73db7fa9394e88ec2de4aeed.zip
Publish docs on change in docs/ directory on master branch (#1532)
Diffstat (limited to '.github/workflows/gh-pages.yml')
-rw-r--r--.github/workflows/gh-pages.yml41
1 files changed, 41 insertions, 0 deletions
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
new file mode 100644
index 00000000..1c98c7f2
--- /dev/null
+++ b/.github/workflows/gh-pages.yml
@@ -0,0 +1,41 @@
+name: Build and deploy MkDocs to GitHub Pages
+
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ docs:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout dokka
+ uses: actions/checkout@v2
+
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ docs_changed:
+ - 'docs/**'
+
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
+
+ - name: Get current dokka version
+ run: echo "::set-env name=DOKKA_VERSION::`./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2 | cut -d '-' -f 1`"
+ if: steps.filter.outputs.docs_changed == 'true'
+
+ - name: Build docs
+ run: ./gradlew mkdocsBuild -Pdokka_version=$DOKKA_VERSION --info
+ if: steps.filter.outputs.docs_changed == 'true'
+
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ if: steps.filter.outputs.docs_changed == 'true'
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./docs/build/mkdocs
+ keep_files: true
+ full_commit_message: Publish ${{ env.DOKKA_VERSION }} documentation