Merge pull request #400 from vmware/fix/131-image-validation #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: documentation | |
on: [push, pull_request] | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Setup JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: zulu | |
java-version: '17' | |
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- name: Install mkdocs and associated plugins | |
run: pip install \ mkdocs-material \ mkdocs-autorefs \ mkdocs-material-extensions \ mkdocstrings \ mkdocstrings-python \ mkdocs-awesome-pages-plugin \ mkdocs-open-in-new-tab | |
- name: Install Python Adapter Library | |
run: pip install -e lib/python/ | |
- name: Generate Java Adapter Library Documentation | |
run: | | |
./lib/java/AdapterLibrary/gradlew -p lib/java/AdapterLibrary dokkaJavadoc | |
mkdir -p docs/references/java_project/java_lib/ | |
cp -r lib/java/AdapterLibrary/build/dokka/javadoc/* docs/references/java_project/java_lib/ | |
- name: Build MKDocs Site | |
# If not on the main branch, build the docs to check for errors, but do not deploy | |
if: github.ref != 'refs/heads/main' | |
run: mkdocs build | |
- name: Deploy MKDocs Site | |
# If on the main branch, deploy the site | |
if: github.ref == 'refs/heads/main' | |
run: mkdocs gh-deploy --force --remote-branch github-pages-documentation | |