Skip to content

Documentation Build and Deploy #662

Documentation Build and Deploy

Documentation Build and Deploy #662

#
# Copyright [2021-present] [ahoo wang <[email protected]> (https://github.com/Ahoo-Wang)].
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Documentation Build and Deploy
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- main
paths:
- 'documentation/**'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
build-and-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.25.0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
server-id: github
cache: gradle
settings-path: ${{ github.workspace }}
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Generate JavaDoc
run: ./gradlew aggregateJavadoc
- name: Copy To Documentation
run: cp -R build/aggregatedJavadoc documentation/docs/public/javadoc
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache-dependency-path: documentation/pnpm-lock.yaml
cache: 'pnpm'
- name: Build VitePress site
working-directory: documentation
run: pnpm install && pnpm run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: './documentation/docs/.vitepress/dist/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4