ci: auto-publish Doxygen HTML to Codeberg Pages on main
Some checks failed
C++ Tests / test-fast (pull_request) Successful in 2m50s
API Docs / doc-build (pull_request) Successful in 37s
C++ Tests / test-cgal (pull_request) Failing after 11m51s

New .gitea/workflows/doxygen-pages.yml runs on every push to main that
touches the public headers, Doxyfile, the markdown-link filter, any
doc/**/*.md, README.md, or the workflow itself.  It reuses the existing
ci-cpp container image and the existing CODEBERG_TOKEN secret already
used by mirror-to-codeberg.yml — no new secret setup needed.

The job force-pushes an orphan commit to the `pages` branch on
codeberg.org/TMoussa/ConformalLabpp, which Codeberg Pages serves from
https://tmoussa.codeberg.page/ConformalLabpp/ (verified live).

README.md gains a Doxygen badge and a Documentation table row pointing
at the Pages URL.  locked-vs-flexible.md (the reviewer-facing doc) is
updated to mention the Pages URL next to the Doxygen-coverage gap.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-05-23 23:30:54 +02:00
parent ba5c9303a3
commit b0c67af922
3 changed files with 81 additions and 1 deletions

View File

@@ -0,0 +1,78 @@
name: Doxygen → Codeberg Pages
# Auto-publish Doxygen HTML to https://tmoussa.codeberg.page/ConformalLabpp/
# every time the public API or docs source changes on main.
#
# Pattern: mirrors mirror-to-codeberg.yml — reuses the existing
# CODEBERG_TOKEN secret + HTTPS push. No new secret setup required.
#
# Trigger: push to main that touches code/include/**, Doxyfile, the
# filter script, doc/**/*.md, README.md, or this workflow file. Also
# manually triggerable via workflow_dispatch.
on:
push:
branches:
- main
paths:
- "code/include/**"
- "Doxyfile"
- "scripts/doxygen-md-filter.sh"
- "doc/**/*.md"
- "README.md"
- "CLAUDE.md"
- ".gitea/workflows/doxygen-pages.yml"
workflow_dispatch: {}
jobs:
publish:
runs-on: eulernest
container:
image: git.eulernest.eu/conformallab/ci-cpp:latest
steps:
- uses: actions/checkout@v4
- name: Configure CMake (Doxygen target only — no compiler needed)
run: cmake -S code -B build
- name: Build Doxygen HTML
run: |
cmake --build build --target doc
test -f doc/doxygen/html/index.html
warnings=$(wc -l < doc/doxygen/doxygen-warnings.log)
echo "DOC ▸ Doxygen warnings: $warnings"
if [ "$warnings" -gt 0 ]; then
echo "::warning::Doxygen produced $warnings warning(s) — review doc/doxygen/doxygen-warnings.log"
head -30 doc/doxygen/doxygen-warnings.log
fi
- name: Publish HTML to codeberg pages branch
env:
CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
run: |
set -eu
# Build the publish payload in a clean scratch dir so the
# orphan branch contains only the Doxygen output (and a
# marker README), never any build/source artefacts.
publish_dir=$(mktemp -d)
cp -r doc/doxygen/html/. "$publish_dir/"
cat > "$publish_dir/README.txt" <<EOF
conformallab++ — Doxygen HTML API documentation.
Auto-generated by .gitea/workflows/doxygen-pages.yml from
commit ${GITHUB_SHA:-$(git rev-parse HEAD)} on $(date -Iseconds).
Source: https://codeberg.org/TMoussa/ConformalLabpp
EOF
cd "$publish_dir"
git init -q -b pages
git config user.email "ci@eulernest"
git config user.name "conformallab CI"
git add -A
git commit -q -m "Auto-publish: Doxygen HTML for ${GITHUB_SHA:-HEAD}"
# Force-push: the pages branch is a publish target, history
# is not interesting (we only ever serve the latest snapshot).
git push -f \
"https://TMoussa:${CODEBERG_TOKEN}@codeberg.org/TMoussa/ConformalLabpp.git" \
pages:pages