mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-20 21:40:57 +00:00
Fixes this [issue](https://github.com/microsoft/onnxruntime/actions/runs/4387534694/jobs/7682945415#step:12:534) and removes the extra PR step in the workflow. Also logs the commit of the main branch that the docs were generated from to a file called version.txt at the root of the API docs tree. Tested for Java API docs and results staged here: https://natke.github.io/onnxruntime/docs/api/java/index.html If approved, I can migrate all of the other API docs generation workflows to use this scheme.
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Update Java API Docs
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- java
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: "apidocs-java"
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
publish:
|
|
name: Generate Java docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'adopt'
|
|
- name: Build with Gradle
|
|
uses: gradle/gradle-build-action@v2
|
|
with:
|
|
build-root-directory: java
|
|
gradle-executable: java/gradlew
|
|
arguments: javadoc
|
|
- name: Get source commit
|
|
id: vars
|
|
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
|
- name: Log source commit
|
|
run: echo $(git rev-parse --short HEAD) > java/build/docs/javadoc/version.txt
|
|
- name: Deploy
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
|
with:
|
|
branch: gh-pages
|
|
folder: java/build/docs/javadoc
|
|
target-folder: docs/api/java
|
|
clean: true
|