diff --git a/.github/workflows/dokka.yml b/.github/workflows/dokka.yml new file mode 100644 index 000000000..b8b90265c --- /dev/null +++ b/.github/workflows/dokka.yml @@ -0,0 +1,57 @@ +name: Deploy API docs + +on: + push: + branches: + - main + - docs + + 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 diff --git a/assets/logo-icon.svg b/assets/logo-icon.svg new file mode 100644 index 000000000..31b81acc1 --- /dev/null +++ b/assets/logo-icon.svg @@ -0,0 +1,48 @@ + + + + + + + + + + diff --git a/designsystem/build.gradle.kts b/designsystem/build.gradle.kts index 11d614fda..86da7ef40 100644 --- a/designsystem/build.gradle.kts +++ b/designsystem/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.dokka.gradle.DokkaTask + version = rootProject.version group = rootProject.group @@ -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 + ) + ) +}