Files
KSLog/.github/workflows/kdocs.yml
T

72 lines
2.2 KiB
YAML

name: Publish KDocs
on:
push:
branches:
- master
permissions:
contents: read
concurrency:
group: kdocs-${{ github.ref }}
cancel-in-progress: false
env:
KOTLIN_CLI_NO_WELCOME_BANNER: "1"
jobs:
generate:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4
with:
distribution: temurin
java-version: "17"
- uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3
- name: Install the declared Android SDK
run: sdkmanager "platforms;android-37" "build-tools;37.0.0"
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.cache/JetBrains/Kotlin
key: kotlin-toolchain-${{ runner.os }}-${{ hashFiles('kotlin', 'kslog/module.yaml', 'project.yaml', 'gradle/libs.versions.toml', 'plugins/dokka/**/*.yaml', 'plugins/dokka/**/*.kt') }}
restore-keys: |
kotlin-toolchain-${{ runner.os }}-
- name: Materialize platform analysis classpaths
run: ./kotlin build -m kslog -p js -p wasmJs
- name: Generate KDocs
run: ./kotlin do dokkaHtml
- name: Upload generated KDocs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: kdocs-html
path: build/dokka/html
if-no-files-found: error
retention-days: 1
deploy:
needs: generate
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- name: Download generated KDocs
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: kdocs-html
path: kdocs-html
- name: Publish KDocs
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./kdocs-html
publish_branch: kdocs