Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add job to build API documentation on push to main #490

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Generate documentation

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
documentation-main:
name: Build Doxygen documentation on `main`

runs-on: ubuntu-latest

permissions:
# Let the default GITHUB_TOKEN commit and push.
contents: write

steps:
- name: Checkout `main`
uses: actions/checkout@v4

- name: Clear out `docs/` subdirectory
run: rm -rf docs

- name: Checkout `gh-pages` into `docs/`
uses: actions/checkout@v4
with:
path: docs
ref: gh-pages

- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy doxygen

- name: Build documentation
# Best way to pass Doxygen config overrides on the command line is
# using stdin.
run: |
( cat Doxyfile ; echo "PROJECT_NUMBER=${{ github.sha }}" ) | doxygen -

- name: Commit new API documentation to `gh-pages`
run: |
cd docs/
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git commit -s -am "Update C++ API docs from commit ${{ github.sha }} on main"
git push
Loading