Skip to content

Create maven-publish.yml #5

Create maven-publish.yml

Create maven-publish.yml #5

Workflow file for this run

name: Deploy Maven Javadocs to GitHub Pages
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache Maven repository
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build Javadocs
run: mvn clean javadoc:javadoc
- name: Add CNAME file
run: |
echo "jd.slz.zetaplugins.com" > target/reports/apidocs/CNAME
# Step 6: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/reports/apidocs