Skip to content

Merge pull request #714 from modelix/feature/delete-branches #57

Merge pull request #714 from modelix/feature/delete-branches

Merge pull request #714 from modelix/feature/delete-branches #57

Workflow file for this run

name: Build and Publish Docs
on:
push:
tags:
- '[0-9]+.[0-9]+.0' # New Major or Minor Releases
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Use tag as version
run: echo "${GITHUB_REF#refs/*/}" > version.txt
- name: Checkout Old Docs Versions for Index Page
uses: actions/checkout@v4
with:
ref: gh-pages
path: build/dokka
- name: Generate Docs with Dokka
run: ./gradlew dokkaHtmlMultiModule
- name: Create symlink to latest version
run: |
cd build/dokka
latestVersion=$(for n in *; do printf '%s\n' "$n"; done | sort -V | grep -E "^[0-9]+\.[0-9]+" | tail -n1)
if [[ -n "${latestVersion}" ]]; then
ln -sf ${latestVersion} latest
fi
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/dokka
keep_files: true