From 3bec9660e9384b1b5c1c150a112d898a37f8e611 Mon Sep 17 00:00:00 2001 From: Rafael Couto Date: Tue, 18 Jul 2023 16:57:16 +0100 Subject: [PATCH] improvement(CI): Adds Doxyfile documentation generator * Adds Doxygen build and pages deploy --- .github/workflows/pipeline.yml | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index a5f3ef5..ddea50e 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -84,4 +84,43 @@ jobs: dotnet pack -o output_package /p:Version=$NUGET_VERSION - name: Publish NuGet Package - run: dotnet nuget push output_package/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json \ No newline at end of file + run: dotnet nuget push output_package/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json + + pages: + runs-on: ubuntu-latest + needs: test + if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') + steps: + - name: Check Tag Pattern + run: | + if [[ "${{ github.ref }}" =~ refs/tags/[0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "Publishing tag ${{ github.ref }}" + else + echo "Skipping job as the tag does not match the pattern X.Y.Z" + exit 1 + fi + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Install Doxygen + run: sudo apt update && sudo apt install -y doxygen graphviz + + - name: Build Doxyfile documentation + run: | + DOCKER_VERSION=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///') + (cat Doxyfile; echo "PROJECT_NUMBER=$DOCKER_VERSION") | doxygen - > /dev/null + + - name: Configure Git + run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + + - name: Push documentation to gh-pages branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doxydocs/html \ No newline at end of file