I am currently working on a Java project in GitHub and I need on every update to manually generate JavaDoc and upload it on GitHub Page. But it’s very tedious.
And I wondering if is possible to automatise this with a CI?
I am currently working on a Java project in GitHub and I need on every update to manually generate JavaDoc and upload it on GitHub Page. But it’s very tedious.
And I wondering if is possible to automatise this with a CI?
Yes is possible, with this code on your GitHub Actions :
name: Deploy Javadoc
on:
push:
branches:
- master
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Deploy JavaDoc 🚀
uses: MathieuSoysal/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: javadoc
java-version: 17
target-folder: javadoc
project: maven # or gradle
Credit: https://github.com/MathieuSoysal/Javadoc-publisher.yml https://github.com/marketplace/actions/deploy-javadoc
This code publishes JavaDoc automatically when you publish your code to "master" branch, your JavaDoc is pushed on javadoc branch, and deployed with GitHub Page.
don't forget to enable GitHub page on your GitHub repo settings
To create a GitHub Actions you need to simply add this yaml file on /.github/workflows/<your-file>.yaml
inside your GitHub repository.
We can use javadoc tool:
With a maven plugin: maven-javadoc-plugin
ttys000:am ➜ ~ javadoc -d doc src\*
Javadoc alternatives:
...
MkDocs. Free • Open Source.
Doxygen. Free • Open Source.
Slate API Docs Generator. Free • Open Source.
DocFX. Free • Open Source.
Sandcastle.
phpDocumentor
NDoc
DoxyS
© 2022 - 2024 — McMap. All rights reserved.