Skip to content

Publish docs

Publish docs #82

Workflow file for this run

name: Publish docs
on:
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
deploy_docs:
runs-on: macos-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Get Docs Version
run: cat gradle.properties | grep --color=never VERSION_NAME >> $GITHUB_OUTPUT
id: version
- name: Install dependencies
run: |
brew install cairo freetype libffi libjpeg libpng zlib
python3 -m pip install --upgrade pip
python3 -m pip install mkdocs mkdocs-material mkdocs-video "mkdocs-material[imaging]" mike
- uses: gradle/gradle-build-action@v3
- run: |
./gradlew --no-configuration-cache \
:dokkaHtmlMultiModule \
:sample:web:wasmJsBrowserDistribution \
:sample:web:jsBrowserDistribution
- name: Copy Dokka and samples output to docs
run: |
cp -r build/dokka/htmlMultiModule/ docs/api/
mkdir -p docs/sample
cp -r sample/web/build/dist/wasmJs/productionExecutable/ docs/sample/wasm/
cp -r sample/web/build/dist/js/productionExecutable/ docs/sample/js/
- name: Configure git for mike
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git fetch origin gh-pages --depth=1
- name: Deploy dev docs with mike 🗿
env:
HAZE_VERSION: ${{ steps.version.outputs.VERSION_NAME }}
DYLD_FALLBACK_LIBRARY_PATH: /opt/homebrew/lib
if: ${{ success() && contains(steps.version.outputs.VERSION_NAME, 'SNAPSHOT') }}
run: mike deploy -u --push ${{ steps.version.outputs.VERSION_NAME }} dev
- name: Deploy release docs with mike 🚀
env:
HAZE_VERSION: ${{ steps.version.outputs.VERSION_NAME }}
DYLD_FALLBACK_LIBRARY_PATH: /opt/homebrew/lib
if: ${{ success() && !contains(steps.version.outputs.VERSION_NAME , 'SNAPSHOT') }}
run: mike deploy -u --push ${{ steps.version.outputs.VERSION_NAME }} latest