Skip to content

Commit

Permalink
Add api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vgarciabnz committed Sep 2, 2024
1 parent 240431b commit 6886f33
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/dokka.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy API docs

on:
push:
branches:
- main

pull_request:

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 :designsystem:dokkaHtml -PremoveSnapshotSuffix

- name: Organize pages structure
run: |
mkdir _site && mkdir _site/api
cp -r designsystem/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
48 changes: 48 additions & 0 deletions assets/logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTask

version = rootProject.version
group = rootProject.group

Expand Down Expand Up @@ -81,3 +83,21 @@ android {
jvmToolchain(17)
}
}

tasks.withType(DokkaTask::class).configureEach {
dokkaSourceSets {
configureEach {
moduleName.set("Mobile UI")
}
}
val dokkaBaseConfiguration = """
{
"customAssets": ["${file("../assets/logo-icon.svg")}"]
}
"""
pluginsMapConfiguration.set(
mapOf(
"org.jetbrains.dokka.base.DokkaBase" to dokkaBaseConfiguration
)
)
}

0 comments on commit 6886f33

Please sign in to comment.