我需要从我的GitHub存储库中生成一个JavaDoc并将其发布到像GitHub Page这样的网页上。
我在StackOverflow上找到了这个解决方案:Publish automatically JavaDoc: with GitHub Actions
name: Deploy Javadoc
on:
push:
branches:
- master
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Deploy JavaDoc 🚀
uses: MathieuSoysal/Javadoc-publisher.yml@v2.0.4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: javadoc
java-version: 17
target-folder: javadoc
但此解决方案仅适用于Maven,不适用于Gradle。
有人知道是否有可能将其改编为Gradle项目吗?
1条答案
按热度按时间t0ybt7op1#
JavaDoc publisher for Gradle
Yes is possible, with this code on your GitHub Actions :
Credit: https://github.com/MathieuSoysal/Javadoc-publisher.ymlhttps://github.com/marketplace/actions/deploy-javadoc
This code publish JavaDoc automatically when you publish to "master" branch, your JavaDoc is pushed on javadoc branch, and deployed with GitHub Page.
Create a GitHub Actions
To create a GitHub Actions you need to simply, add this yaml file on
/.github/workflows/your-file.yaml
inside your GitHub repository.