Skip to content

feat: Use dokka v2 to generate html vs markdown documentation. #12

feat: Use dokka v2 to generate html vs markdown documentation.

feat: Use dokka v2 to generate html vs markdown documentation. #12

Workflow file for this run

name: Deploy Dokka Docs
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
- name: Build Dokka HTML
run: ./gradlew dokkaGenerateHtml --info
- name: Debug - List build directory
run: |
echo "=== Root build directory ==="
ls -la build/ || echo "No build/ directory"
echo ""
echo "=== Looking for dokka output ==="
find . -name "dokka" -o -name "dokkaHtml" -type d
echo ""
echo "=== All HTML files ==="
find . -name "*.html" -path "*/build/*"
- name: Determine deployment path
id: deploy-path
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "path=." >> $GITHUB_OUTPUT
else
BRANCH_NAME=$(echo ${{ github.ref }} | sed 's/refs\/heads\///' | sed 's/\//-/g')
echo "path=$BRANCH_NAME" >> $GITHUB_OUTPUT
fi
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./library/build/dokka/html
destination_dir: ${{ steps.deploy-path.outputs.path }}
keep_files: true # Important! Prevents deleting other directories