Generate API reference via Doxygen and push to GitHub Pages #56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Generate API reference via Doxygen and push to GitHub Pages | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch_name: | |
| description: 'Which git branch should I check out?' | |
| required: true | |
| python_version: | |
| description: 'Python SDK version to use for documentation' | |
| required: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| BRANCH_NAME: ${{ github.event.inputs.branch_name }} | |
| PYTHON_VERSION: ${{ github.event.inputs.python_version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch_name }} | |
| fetch-depth: 0 # fetch all commits/branches for gitversion | |
| - name: Setup Git config | |
| run: git config user.name ChrisChen2023 && git config user.email [email protected] | |
| - name: Install Doxygen | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y doxygen graphviz | |
| # Generate Python API reference | |
| - name: Generate Documentation for Python | |
| run: | | |
| echo "PROJECT_NUMBER=${PYTHON_VERSION}" >> doxygen/python-config | |
| mkdir -p "${PYTHON_VERSION}" | |
| echo "OUTPUT_DIRECTORY=${PYTHON_VERSION}" >> doxygen/python-config | |
| doxygen doxygen/python-config | |
| # Deploy the generated HTML files to the gh-pages branch | |
| - name: Deploy to gh-pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: ${{ env.PYTHON_VERSION }}/html | |
| target-folder: ${{ env.PYTHON_VERSION }} |