Skip to content

Commit

Permalink
add md docs job
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisives committed Aug 1, 2024
1 parent aa44e5a commit 8a7b2db
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/add-md-docs-to-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Add mod docs to repo

on:
pull_request:
branches:
- main
- test-docs-job

jobs:
docs:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
cache: gradle

- name: Create docs
run: |
./gradlew :hmkit-fleet:dokkaGfm
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
11 changes: 8 additions & 3 deletions hmkit-fleet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ dokkaGfm {
outputDirectory.set(file("$rootDir/docs/"))
}

tasks.register('renameDokkaReadme') {
doLast {
file("$rootDir/docs/index.md").renameTo("$rootDir/docs/README.md")
}
}

tasks.register('writeRedirectIndexHtml') {
doLast {
String content = "<html>\n" +
Expand All @@ -81,6 +87,5 @@ tasks.register('writeRedirectIndexHtml') {
}
}

tasks.dokkaHtml {
finalizedBy writeRedirectIndexHtml
}
tasks.dokkaHtml.finalizedBy writeRedirectIndexHtml
tasks.dokkaGfm.finalizedBy renameDokkaReadme

0 comments on commit 8a7b2db

Please sign in to comment.