-
Notifications
You must be signed in to change notification settings - Fork 18
52 lines (48 loc) · 1.46 KB
/
docs.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build and Deploy API Documentation
on:
push:
tags:
# Match 1.0.0 but not 1.0.0-rc1 or other suffixes
- '[1-9]+.[0-9]+.[0-9]+'
jobs:
generate_docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the branch with the latest code
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
path: 'code'
- name: Checkout the branch with the docs
uses: actions/checkout@v4
with:
ref: 'docs'
path: 'docs'
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Copy docs to the code directory
run: |
mkdir -p ./code/docs/dokka
cp -R ./docs/current ./code/docs/dokka
cp -R ./docs/history ./code/docs/dokka
- name: Generate Dokka Documentation
working-directory: ./code
run: ./gradlew dokkaHtmlMultiModule
- name: Update Docs
run: |
cp -R code/docs/dokka/history docs/
cp -R code/docs/dokka/current docs/
- name: Push updated docs
working-directory: ./docs
run: |
git add history
git add current
git config user.name github-actions
git config user.email [email protected]
git commit -m "Update API documentation for ${{ github.ref_name }}"
git push origin docs