Skip to content

Merge pull request #398 from modelix/dependabot/gradle/org.openapi.ge… #41

Merge pull request #398 from modelix/dependabot/gradle/org.openapi.ge…

Merge pull request #398 from modelix/dependabot/gradle/org.openapi.ge… #41

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@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Use tag as version
run: echo "${GITHUB_REF#refs/*/}" > version.txt
- name: Checkout Old Docs Versions for Index Page
uses: actions/checkout@v3
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 [[ -z "${latestVersion}" ]]; then
ln -sf ${latestVersion} latest
fi
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/dokka
keep_files: true