Skip to content

Commit

Permalink
Use GitHub Actions to generate API doc on the gh-pages branch HamaWhi…
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaWhiteGG committed Oct 7, 2023
1 parent 6036346 commit e27614e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/generate-javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Generate Javadoc and Update gh-pages

on:
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Build and generate Javadoc
run: mvn javadoc:javadoc

- name: Deploy to gh-pages
run: |
git config --global user.name "HamaWhiteGG"
git config --global user.email "baisongxx@gmail.com"
git checkout --orphan gh-pages
git reset --hard
git clean -df
mv target/site/apidocs/* .
git add .
git commit -m "Update Javadoc"
git push origin gh-pages --force
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<locale>en</locale>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<additionalJOptions>
<additionalJOption>-J-Duser.language=en</additionalJOption>
<additionalJOption>-J-Duser.region=US</additionalJOption>
</additionalJOptions>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down

0 comments on commit e27614e

Please sign in to comment.