Skip to content

Commit

Permalink
ci: add github pages doxygen job
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Linne <[email protected]>
  • Loading branch information
alexanderlinne committed Jul 26, 2024
1 parent 3c839b4 commit 0e11a7b
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- "[0-9]+.[0-9]+.[0-9]+"
pull_request:
types: [opened, reopened, synchronize]
merge_group:
types: [checks_requested]

jobs:
formatting:
Expand Down Expand Up @@ -55,8 +57,51 @@ jobs:
dotnet-version: 8.0.303
- name: Run tests
run: dotnet test -c Debug
deploy:
name: Deploy
publish-docs:
name: Publish documentation
runs-on: ubuntu-latest
needs:
- formatting
- coverage
- run-tests
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup doxygen
run: sudo apt-get install doxygen
- name: Create temporary directory
run: |
tmpdir=$(mktemp -d -p "$RUNNER_TEMP")
mkdir -p $tmpdir
relative_path=$(realpath --relative-to="$GITHUB_WORKSPACE" "$tmpdir")
echo "Created temporary directory $tmpdir ($relative_path relative to $GITHUB_WORKSPACE)"
echo "DOCS_TEMP_DIR=$relative_path" >> "$GITHUB_ENV"
- name: Checkout gh-pages branch
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: gh-pages
path: ${{ env.DOCS_TEMP_DIR }}
- name: Generate documentation
working-directory: ${{ env.DOCS_TEMP_DIR }}
run: |
find . -mindepth 1 -not -path './.git*' -delete
doxygen "$GITHUB_WORKSPACE/documentation/Doxyfile"
touch .nojekyll
- name: Commit and push changes
if: github.ref == 'refs/tags/[0-9]+.[0-9]+.[0-9]+'
working-directory: ${{ env.DOCS_TEMP_DIR }}
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add -A
if [[ "$(git status --porcelain)" ]]; then
git commit -m "Update documentation for $GITHUB_REF_NAME"
git push
else
echo "No changes to commit"
fi
publish-packages:
name: Publish packages
if: github.ref == 'refs/tags/[0-9]+.[0-9]+.[0-9]+'
runs-on: windows-latest
environment: deploy
Expand Down

0 comments on commit 0e11a7b

Please sign in to comment.