Skip to content

Commit

Permalink
Create a workflow to deploy the Dokka documentation (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 authored Oct 31, 2024
1 parent 559d4c1 commit a5d3e16
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy_dokka_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Dokka documentation

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
deploy-dokka-documentation:
name: Deploy Dokka documentation
runs-on: ubuntu-latest
env:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties
- name: Build Dokka documentation
run: ./gradlew :dokkaGenerate
- name: Deploy Dokka documentation
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: build/dokka/html
single-commit: true
target-folder: api
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class PillarboxAndroidLibraryPublishingPlugin : Plugin<Project> {
pluginsConfiguration.getByName<DokkaHtmlPluginParameters>("html") {
customStyleSheets.from(rootProject.projectDir.resolve("dokka/styles/pillarbox.css"))
footerMessage.set("© SRG SSR")
homepageLink.set("https://srgssr.github.io/pillarbox-android")
// TODO Enable this once we have some content there
// homepageLink.set("https://srgssr.github.io/pillarbox-android")
templatesDir.set(rootProject.projectDir.resolve("dokka/templates"))
}
}
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ dokka {
customAssets.from("dokka/images/logo-icon.svg") // TODO Use Pillarbox logo
customStyleSheets.from("dokka/styles/pillarbox.css")
footerMessage.set("© SRG SSR")
homepageLink.set("https://srgssr.github.io/pillarbox-android")
// TODO Enable this once we have some content there
// homepageLink.set("https://srgssr.github.io/pillarbox-android")
templatesDir.set(file("dokka/templates"))
}
}
Expand Down

0 comments on commit a5d3e16

Please sign in to comment.