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?
I am currently working on a Java Maven project in GitHub, and I'm building a JavaDoc and posting it to a GitHub page.
And I was wondering if it would be possible to automate this with a GitHub Actions, if so how?
Yes, it is possible with this code in your GitHub Actions directory:
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
Credit: https://github.com/MathieuSoysal/Javadoc-publisher.yml https://github.com/marketplace/actions/deploy-publish-javadoc
Add the above YAML file to /.github/workflows/your-file.yaml
inside your GitHub repository. It publishes the JavaDoc automatically when you publish to the "master" or "main" branch. Your JavaDoc is pushed onto the javadoc branch, and is deployed with GitHub Pages.
Don't forget to enable GitHub Pages on your GitHub repo settings
© 2022 - 2024 — McMap. All rights reserved.