chore: update readme #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Javadoc | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' # Prevents infinite loop by ignoring Javadoc-only commits | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set Up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '8' | |
- name: Generate Javadoc | |
run: mvn javadoc:javadoc | |
- name: Move Javadocs to docs/ | |
run: | | |
rm -rf docs/ | |
mv target/reports/apidocs docs/ | |
- name: Commit and Push Javadocs | |
run: | | |
git config --global user.name 'shivam1608' | |
git config --global user.email '64302819+shivam1608@users.noreply.github.com' | |
git checkout -B javadoc # Switch to javadoc branch (create if missing) | |
git add docs/** | |
# Check if there are actual changes | |
if git diff --cached --quiet; then | |
echo "No changes in Javadocs, skipping commit." | |
exit 0 | |
fi | |
git commit -m "Update Javadocs [skip ci]" | |
git push -u origin javadoc -f | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |