-
Notifications
You must be signed in to change notification settings - Fork 8
39 lines (38 loc) · 1.18 KB
/
docs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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