Skip to content

Generate API doc

Generate API doc #8

name: Maven Generate Javadoc
on:
push:
branches: [ "dev" ]
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'
cache: maven
- name: Build with Maven
run: mvn clean install -DskipTests
with:

Check failure on line 26 in .github/workflows/generate-javadoc.yml

View workflow run for this annotation

GitHub Actions / Maven Generate Javadoc

Invalid workflow file

The workflow is not valid. .github/workflows/generate-javadoc.yml (Line: 26, Col: 9): Unexpected value 'with'
gpg_private_key: ${{ secrets.GPG_SECRET }}
gpg_passphrase: ${{ secrets.GPG_PASSWORD }}
- 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
# Find all modules containing the target/site/apidocs directory
for dir in $(find . -type d -name target/site/apidocs); do
# Remove the prefix './' and suffix 'target/site/apidocs', to get relative path of module
module_dir=${dir:2:-19}
# Create corresponding directory
mkdir -p "$module_dir"
# Copy Javadoc to corresponding directory
cp -R "$dir" "$module_dir"
done
git add .
git commit -m "Update Javadoc"
git push origin gh-pages --force
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}