-
Notifications
You must be signed in to change notification settings - Fork 12
47 lines (44 loc) · 1.27 KB
/
javadocs.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
name: Development Javadocs
on:
push:
branches:
- development
- main
- 'legacy/*'
create:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '23'
- name: Generate Documentation
run: |
gradle javadoc
- name: Find target directory
id: target_dir
run: |
branch=${GITHUB_REF#refs/heads/}
if [ "$branch" == "development" ]; then
echo "name=development" >> "$GITHUB_OUTPUT"
elif [ "$branch" == "main" ]; then
echo "name=latest" >> "$GITHUB_OUTPUT"
elif [[ $branch == legacy/* ]]; then
echo "name=${branch#legacy/}" >> "$GITHUB_OUTPUT"
else
echo "name=ignore" >> "$GITHUB_OUTPUT"
fi
- name: Deploy docs
if: ${{ steps.target_dir.outputs.name != 'ignore' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./jda-commands/build/docs/javadoc
branch: docs
target-folder: javadocs/${{ steps.target_dir.outputs.name }}