Files
Meshtastic-Android/.github/workflows/docs-deploy.yml
T

87 lines
2.7 KiB
YAML

name: Deploy Documentation
# Publishes the main-branch docs snapshot to /main/ (and refreshed Dokka to
# /api/) on the persistent gh-pages branch. The site root (latest release)
# and /vX.Y.Z/ folders are owned by docs-release.yml and are left untouched.
on:
push:
branches: [main]
paths:
# Dokka sources (KDoc in source files)
- 'androidApp/src/**'
- 'core/**/src/**'
- 'feature/**/src/**'
- 'desktopApp/src/**'
# Docs site sources
- 'docs/**'
- 'feature/docs/**'
# Build infrastructure
- 'build-logic/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- '.github/workflows/docs-deploy.yml'
- 'scripts/docs/**'
workflow_dispatch:
permissions:
contents: write
# Shares the group with docs-release.yml so gh-pages pushes serialize.
# cancel-in-progress must stay false: a snapshot deploy must never cancel an
# in-flight release publish (GitHub still coalesces queued runs to one).
concurrency:
group: pages
cancel-in-progress: false
jobs:
publish:
if: github.repository == 'meshtastic/Meshtastic-Android'
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
with:
submodules: true
fetch-depth: 0
- name: Gradle Setup
uses: ./.github/actions/gradle-setup
with:
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '4.0.6'
bundler-cache: true
working-directory: docs
- name: Generate Docs Site (main channel)
run: ./gradlew generateDocsBundle validateDocsBundle publishDocsSite -Pdocs.channel=main -Pci=true
# Dokka (Gradle) and Jekyll (Ruby) are independent — Dokka's output is only
# copied in afterwards — so run them concurrently to overlap the two slowest
# steps (~10 min Dokka vs ~5 min Jekyll) instead of summing them (~16 -> ~11 min).
- name: Build Dokka + Jekyll concurrently
run: |
set -euo pipefail
BUNDLE_GEMFILE=docs/Gemfile bundle exec jekyll build \
--source build/_site/main \
--destination build/jekyll_site \
--baseurl /${{ github.event.repository.name }}/main &
jekyll_pid=$!
./gradlew dokkaGeneratePublicationHtml --no-configuration-cache
wait "$jekyll_pid"
- name: Stage channels
run: |
mkdir -p build/pages_staging
cp -r build/jekyll_site build/pages_staging/main
cp -r build/dokka/html build/pages_staging/api
- name: Publish to gh-pages
run: scripts/docs/publish-to-gh-pages.sh build/pages_staging main api