ci: use GITHUB_TOKEN for docs #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Gen documentation | |
on: | |
push: | |
branches: [ main ] | |
paths: [ '**.kt', '**.java', '.github/workflows/docs.yml' ] | |
pull_request: | |
branches: [ main ] | |
paths: [ '**.kt', '**.java', '.github/workflows/docs.yml' ] | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 1.11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Build documentation Dokka plugin https://github.com/Kotlin/dokka | |
run: ./gradlew dokkaHTML dokkaJavadoc | |
- name: Copy to documentation website location | |
run: | | |
cp -rf build/dokka/javadoc public | |
cp -rf build/dokka/html public/kotlin | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |