-
-
Notifications
You must be signed in to change notification settings - Fork 109
62 lines (53 loc) · 1.6 KB
/
javadoc-pages.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
53
54
55
56
57
58
59
60
61
62
name: Deploy Javadoc
on:
push:
branches:
- master
- main
- development
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get commit author
id: get-author
run: |
echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT
echo "email=$(git log -1 --pretty=format:'%ae')" >> $GITHUB_OUTPUT
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Generate Javadoc
run: mvn clean javadoc:aggregate -pl :openaudiomc-api -U
- name: Checkout javadoc branch
uses: actions/checkout@v3
with:
ref: javadoc
path: javadoc-branch
clean: true
- name: Clear existing javadoc
run: |
cd javadoc-branch
git rm -rf javadoc || true
mkdir -p javadoc
- name: Copy new javadoc
run: cp -r api/target/reports/apidocs/* javadoc-branch/javadoc/
- name: Commit and push javadoc
run: |
cd javadoc-branch
git config --local user.email "${{ steps.get-author.outputs.email }}"
git config --local user.name "${{ steps.get-author.outputs.name }}"
git add javadoc
if git diff --staged --quiet; then
echo "No changes to commit"
exit 0
fi
git commit -m "Update Javadoc from ${{ github.sha }}"
git push origin javadoc