Skip to content

Commit

Permalink
[ANDROSDK-1941] add action for publishing api docs in Github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
taridepaco committed Nov 26, 2024
1 parent 5d9c141 commit 6239377
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 3 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/dokka.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy API docs

on:
push:
branches:
- master
- ANDROSDK-1941

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Change wrapper permission
run: chmod +x ./gradlew

- name: Build Java docs
run: ./gradlew :core:dokkaHtml -PremoveSnapshotSuffix

- name: Organize pages structure
run: |
mkdir _site && mkdir _site/api
cp -r core/build/dokka/html/* _site/api
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
10 changes: 7 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTask

/*
* Copyright (c) 2016, University of Oslo
*
Expand Down Expand Up @@ -203,9 +205,7 @@ detekt {
buildUponDefaultConfig = false
}

tasks.dokkaJavadoc.configure {
dependsOn("kaptReleaseKotlin")

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
configureEach {
perPackageOption {
Expand All @@ -215,3 +215,7 @@ tasks.dokkaJavadoc.configure {
}
}
}

tasks.dokkaJavadoc.configure {
dependsOn("kaptReleaseKotlin")
}

0 comments on commit 6239377

Please sign in to comment.