Skip to content

generate docs

generate docs #98

Workflow file for this run

name: generate docs
on:
push:
branches: [main, development]
pull_request:
branches: [main, development]
release:
types: [released]
jobs:
create-documentation:
runs-on: ubuntu-latest
container:
image: ghcr.io/dnkpp/gcc:14
# this is required for the gh-pages deployment
permissions:
contents: write
steps:
- uses: actions/checkout@v4
# we must configure, because the Doxyfile is generated via cmake
- name: Configure
run: |
cmake \
-S . \
-B build \
--log-level=VERBOSE \
-DMIMICPP_CONFIGURE_DOXYGEN=ON \
-DMIMICPP_BUILD_TESTS=OFF \
-DMIMICPP_BUILD_EXAMPLES=OFF
- name: Generate Doxygen Documentation
uses: mattnotmitt/doxygen-action@edge
with:
doxyfile-path: build/docs/Doxyfile
- name: Upload html documentation
uses: actions/upload-artifact@v4
with:
name: HTML-Documentation
path: build/docs/html
# publish to main gh-pages, when main branch is pushed
- name: Deploy to GitHub main Pages
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/docs/html
# publish to dev gh-pages, when development branch is pushed
- name: Deploy to GitHub dev Pages
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/docs/html
publish_branch: dev-gh-pages
release-documentation:
runs-on: ubuntu-latest
needs: create-documentation
if: ${{ github.event_name == 'release' }}
# this is required for the asset attachment
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: HTML-Documentation
path: ./documentation
- name: zip documentation
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: "documentation.zip"
path: ./documentation
- name: attach release assets
uses: ncipollo/release-action@v1
with:
artifacts: "documentation.zip"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
artifactErrorsFailBuild: true