Skip to content

Commit d3f904c

Browse files
Added javadoc workflow
1 parent 984d59c commit d3f904c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy Maven Javadocs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up JDK
17+
uses: actions/setup-java@v3
18+
with:
19+
distribution: 'temurin'
20+
java-version: '21'
21+
22+
- name: Cache Maven repository
23+
uses: actions/cache@v3
24+
with:
25+
path: ~/.m2
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
30+
- name: Build Javadocs
31+
run: mvn clean javadoc:javadoc
32+
33+
- name: Add CNAME file
34+
run: |
35+
echo "jd.slz.zetaplugins.com" > target/reports/apidocs/CNAME
36+
37+
# Step 6: Deploy to GitHub Pages
38+
- name: Deploy to GitHub Pages
39+
uses: peaceiris/actions-gh-pages@v3
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: target/reports/apidocs

0 commit comments

Comments
 (0)