Documentation: host different versions of docs in javadoc branch #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: JavaDoc | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: adopt | |
cache: maven | |
- name: Generate Javadoc with Maven | |
run: | | |
mvn javadoc:aggregate | |
mv target/site/apidocs ${{ runner.temp }}/docs-snapshot | |
- uses: actions/checkout@v3 | |
with: | |
ref: docs | |
- name: Copy Javadoc to Documentation Branch | |
run: | | |
mkdir -p ${{ runner.temp }}/docs | |
mv 0.1.1.2 ${{ runner.temp }}/docs/ | |
mv ${{ runner.temp }}/docs-snapshot/index.html ${{ runner.temp }}/docs-snapshot/index-main.html | |
mv ${{ runner.temp }}/docs-snapshot ${{ runner.temp }}/docs/0.1.1.2-snapshot | |
- name: Deploy to Documentation Branch | |
uses: JamesIves/github-pages-deploy-action@v4.4.1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: docs | |
clean: true | |
folder: ${{ runner.temp }}/docs | |
target-folder: . |