2024-01-11 16:04:38 +08:00
|
|
|
name: Build and Publish Docs to GitHub Pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- created
|
|
|
|
# Allow running this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-02-06 18:13:41 +08:00
|
|
|
|
|
|
|
- name: Set up JDK 21
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
java-version: '21'
|
|
|
|
distribution: 'temurin'
|
|
|
|
cache: 'maven'
|
|
|
|
|
|
|
|
- name: Generate Javadoc
|
|
|
|
run: mvn javadoc:aggregate -DskipTests
|
|
|
|
|
|
|
|
- name: Set up Node.js
|
2024-01-11 16:04:38 +08:00
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '20.x'
|
2024-02-06 18:13:41 +08:00
|
|
|
|
2024-01-11 16:04:38 +08:00
|
|
|
- run: cd docs && npm ci
|
|
|
|
- run: cd docs && npm run build
|
2024-02-06 18:13:41 +08:00
|
|
|
- run: cp -R target/site/apidocs docs/build/
|
2024-01-11 16:04:38 +08:00
|
|
|
|
|
|
|
- name: Setup Pages
|
|
|
|
uses: actions/configure-pages@v3
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v2
|
|
|
|
with:
|
|
|
|
# Upload entire repository
|
|
|
|
path: './docs/build/.'
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v2
|