Skip to content

CI and deploy steps for docs #36

CI and deploy steps for docs

CI and deploy steps for docs #36

name: Build & Deploy javadoc
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
branches:
# testing only, not allowed to run on OpenLineage/OpenLineage repo
- test-docs-deploy
permissions:
contents: read
pages: write
id-token: write
jobs:
generate_javadoc:
if: |
(github.ref == 'refs/heads/test-docs-deploy' && github.repository != 'OpenLineage/OpenLineage' ) ||
(github.ref != 'refs/heads/test-docs-deploy' && github.repository == 'OpenLineage/OpenLineage')
name: "Generate Java docs"
env:
branch: ${{ (github.head_ref || github.ref_name) == 'test-docs-deploy' && 'test-docs-deploy' || 'main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '11'
- uses: actions/checkout@v4
- name: Generate new java doc
run: |
cd client/java
./gradlew --console=plain javadoc
- name: Get git branch
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch
git checkout ${{ env.branch }}
- name: Clear existing javadoc
run: rm -rf website/static/apidocs/javadoc
- name: Copy docs to website directory
run: cp -r client/java/build/docs/javadoc website/static/apidocs
- name: Commit javadoc
run: |
git pull
git add website/static/apidocs/javadoc/
git commit -m "[generated] reloading javadoc"
git push
site-deploy-changes:
uses: ./.github/workflows/site-deploy.yml
needs: generate_javadoc
with:
branch: ${{ (github.head_ref || github.ref_name) == 'test-docs-deploy' && 'test-docs-deploy' || 'main' }}