-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4efaa9
commit 2a23ea3
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build and Publish Dokka Documentation | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main", "dev" ] | ||
workflow_dispatch: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
dokka: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 1. Checkout the code | ||
- uses: actions/checkout@v4 | ||
|
||
# 2. Set up JDK | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: zulu | ||
java-version: 17 | ||
|
||
# 3. Run dokkaHtmlMultiModule | ||
- name: Generate Dokka Documentation | ||
run: ./gradlew dokkaHtmlMultiModule | ||
|
||
# 4. Checkout gh-pages branch to publish documentation | ||
- name: Checkout gh-pages | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages # Use the `gh-pages` branch | ||
path: gh-pages # Specify the path where `gh-pages` branch will be checked out | ||
|
||
# 5. Copy generated documentation to gh-pages directory | ||
- name: Copy Dokka Documentation | ||
run: | | ||
rm -rf gh-pages/* # Clear existing files | ||
cp -R build/dokka/htmlPartial/* gh-pages/ # Copy the newly generated documentation | ||
# 6. Publish documentation to GitHub Pages | ||
- name: Publish Documentation | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_branch: gh-pages | ||
publish_dir: gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters