From a5d3e16b05ca036309ef9bdb99f718c18a6f986e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 31 Oct 2024 11:51:28 +0100 Subject: [PATCH] Create a workflow to deploy the Dokka documentation (#775) --- .../workflows/deploy_dokka_documentation.yml | 42 +++++++++++++++++++ ...PillarboxAndroidLibraryPublishingPlugin.kt | 3 +- build.gradle.kts | 3 +- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy_dokka_documentation.yml diff --git a/.github/workflows/deploy_dokka_documentation.yml b/.github/workflows/deploy_dokka_documentation.yml new file mode 100644 index 000000000..b5ba09cc8 --- /dev/null +++ b/.github/workflows/deploy_dokka_documentation.yml @@ -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 diff --git a/build-logic/plugins/src/main/java/ch/srgssr/pillarbox/gradle/PillarboxAndroidLibraryPublishingPlugin.kt b/build-logic/plugins/src/main/java/ch/srgssr/pillarbox/gradle/PillarboxAndroidLibraryPublishingPlugin.kt index 157815855..d4a7f3180 100644 --- a/build-logic/plugins/src/main/java/ch/srgssr/pillarbox/gradle/PillarboxAndroidLibraryPublishingPlugin.kt +++ b/build-logic/plugins/src/main/java/ch/srgssr/pillarbox/gradle/PillarboxAndroidLibraryPublishingPlugin.kt @@ -103,7 +103,8 @@ class PillarboxAndroidLibraryPublishingPlugin : Plugin { pluginsConfiguration.getByName("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")) } } diff --git a/build.gradle.kts b/build.gradle.kts index f9fea6eb9..78fdb46f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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")) } }