Home > Net >  Publish automatically JavaDoc: with GitHub Actions
Publish automatically JavaDoc: with GitHub Actions

Time:02-05

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?

CodePudding user response:

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:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-java@v2
        with:
          java-version: 17
          distribution: 'adopt'
      - name: Generate Javadoc
        run: mvn org.apache.maven.plugins:maven-javadoc-plugin:3.3.1:aggregate
      - name: Deploy            
  •  Tags:  
  • Related