Issue
Introduction
I am currently working on a Java Maven project in GitHub, and I'm building a JavaDoc and posting it to a GitHub page.
Question
And I was wondering if it would be possible to automate this with a GitHub Actions, if so how?
Solution
JavaDoc publisher
Yes is possible, with this code on your GitHub Actions :
name: Deploy Javadoc
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Deploy JavaDoc 🚀
uses: MathieuSoysal/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
java-version: 17
Credit: https://github.com/MathieuSoysal/Javadoc-publisher.yml https://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.
don't forget to enable GitHub page on your GitHub repo settings
Create a GitHub Actions
To create a GitHub Actions, add the yaml file on /.github/workflows/your-file.yaml
.
Answered By - JavaMan
Answer Checked By - Timothy Miller (JavaFixing Admin)