Multiverse-Core/.github/workflows/dispatch.javadoc.yml

55 lines
1.5 KiB
YAML
Raw Normal View History

2024-11-14 05:25:13 +01:00
name: 'Dispatch: Deploy Javadoc'
on:
workflow_dispatch:
inputs:
target_tag:
description: 'Version to generate javadoc'
required: true
2024-11-14 06:38:42 +01:00
replace_latest:
2024-11-14 06:40:53 +01:00
description: 'Replace the latest folder'
2024-11-14 06:38:42 +01:00
type: boolean
2024-11-14 05:25:13 +01:00
jobs:
javadocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.target_tag }}
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: build javadoc
uses: gradle/gradle-build-action@v2
with:
arguments: javadoc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_VERSION: ${{ inputs.target_tag }}
2024-11-14 06:26:32 +01:00
2024-11-14 06:38:42 +01:00
- name: Copy javadoc to deploy folder
2024-11-14 06:26:32 +01:00
run: |
mkdir -p build/docs/javadoc-deploy/${{ inputs.target_tag }}
cp -r build/docs/javadoc/* build/docs/javadoc-deploy/${{ inputs.target_tag }}
2024-11-14 06:38:42 +01:00
- name: Copy javadoc to latest folder
if: inputs.replace_latest
run: |
mkdir -p build/docs/javadoc-deploy/latest
cp -r build/docs/javadoc/* build/docs/javadoc-deploy/latest
2024-11-14 05:25:13 +01:00
- name: Deploy javadoc to gh pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
2024-11-14 06:26:32 +01:00
folder: build/docs/javadoc-deploy
2024-11-14 05:25:13 +01:00
branch: javadoc
2024-11-14 06:26:32 +01:00
target-folder: javadoc
clean: false
2024-11-14 05:25:13 +01:00
commit-message: Deploy javadoc for ${{ inputs.target_tag }}