diff --git a/.github/workflows/check-dfdutils.yml b/.github/workflows/check-dfdutils.yml index aeb2ab2..f414f7a 100644 --- a/.github/workflows/check-dfdutils.yml +++ b/.github/workflows/check-dfdutils.yml @@ -31,7 +31,7 @@ on: workflow_call: jobs: - check-libktx-only: + check-dfdutils: strategy: matrix: os: [ macos-latest, ubuntu-latest, windows-latest ] @@ -71,10 +71,16 @@ jobs: # # included (used for version creation) # fetch-depth: 0 + - name: Install Doxygen + uses: ssciwr/doxygen-install@v1 + - name: Configure dfdutils run: cmake -B ${{ env.BUILD_DIR }} -G "${{ matrix.generator }}" - - name: Build dfdutils Release config + - name: Build dfdutils run: cmake --build ${{ env.BUILD_DIR }} --config=${{ matrix.config }} + - name: Build docs + if: matrix.config == 'Release' + run: cmake --build ${{ env.BUILD_DIR }} --config=${{ matrix.config }} --target docs - name: Check latest .inl files are checked in run: git diff --quiet *.inl @@ -85,7 +91,7 @@ jobs: build/${{ matrix.config }}/testinterpretdfd build/${{ matrix.config }}/testbidirectionalmapping -# Presumable because it is built as an OBJECT library, a ninja build does +# Presumably because it is built as an OBJECT library, a ninja build does # not create a .a file. # - name: Upload artifact libdfdutils # if: matrix.config == 'Release' @@ -94,3 +100,38 @@ jobs: # name: libdfdutils-${{ runner.os }}-${{ runner.arch }} # path: ${{env.BUILD_DIR}}/Release/*dfdutils* + - name: Upload generated HTML documentation for GitHub Pages + if: matrix.os == 'ubuntu-latest' && matrix.config == 'Release' + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: ${{ env.BUILD_DIR }}/doc/html + + deploy: + name: Deploy to GitHub Pages + # Add a dependency to the build job + needs: check-dfdutils + # Only deploy when building `main`. + if: github.ref == 'refs/heads/main' + # Alternatively, only deploy when building for a release tag. Note that + # filtering in on: means the only tags the workflow runs for are release + # tags. +# if: startsWith(github.ref, 'refs/tags') + + runs-on: ubuntu-latest + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify deployment step + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4