Skip to content

Doxygen API Docs

Doxygen API Docs #3

name: Doxygen API Docs
on:
schedule:
- cron: '0 4 * * 0' # Sunday 04:00 UTC
workflow_dispatch:
permissions:
contents: read
env:
BRANCH_NAME: ${{ github.ref_name }}
concurrency:
group: doxygen-deploy
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v6
- name: Install Doxygen and Graphviz
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz
- name: Build Doxygen docs
run: doxygen Doxyfile
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: doxygen_build
path: docs/api/html/
retention-days: 1
deploy:
if: github.repository_owner == 'mavlink'
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Download Artifact
uses: actions/download-artifact@v7
with:
name: doxygen_build
path: ~/_api_docs
- name: Checkout API docs repo
uses: actions/checkout@v6
with:
repository: mavlink/api.qgroundcontrol.com
token: ${{ secrets.PX4BUILDBOT_ACCESSTOKEN }}
path: api.qgroundcontrol.com
- name: Deploy docs
env:
BRANCH: ${{ env.BRANCH_NAME }}
run: |
SAFE_BRANCH="${BRANCH//[^a-zA-Z0-9._-]/_}"
rm -rf "api.qgroundcontrol.com/${SAFE_BRANCH}"
mkdir -p "api.qgroundcontrol.com/${SAFE_BRANCH}"
cp -r ~/_api_docs/* "api.qgroundcontrol.com/${SAFE_BRANCH}/"
cd api.qgroundcontrol.com
git config user.email "bot@px4.io"
git config user.name "PX4BuildBot"
git add "${SAFE_BRANCH}"
if git diff --cached --quiet; then
echo "No documentation changes to deploy."
exit 0
fi
git commit -m "QGC Doxygen API docs update $(date -u +%Y-%m-%d)"
git push origin main