diff --git a/.github/workflows/add-md-docs-to-repo.yml b/.github/workflows/add-md-docs-to-repo.yml new file mode 100644 index 0000000..85bec87 --- /dev/null +++ b/.github/workflows/add-md-docs-to-repo.yml @@ -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 diff --git a/hmkit-fleet/build.gradle b/hmkit-fleet/build.gradle index 8d3c858..4ed39fa 100644 --- a/hmkit-fleet/build.gradle +++ b/hmkit-fleet/build.gradle @@ -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 = "\n" + @@ -81,6 +87,5 @@ tasks.register('writeRedirectIndexHtml') { } } -tasks.dokkaHtml { - finalizedBy writeRedirectIndexHtml -} \ No newline at end of file +tasks.dokkaHtml.finalizedBy writeRedirectIndexHtml +tasks.dokkaGfm.finalizedBy renameDokkaReadme