From 54fe4b40aa4d5d9ed60b0203baef34accfb4a097 Mon Sep 17 00:00:00 2001 From: Philipp Basler <28863303+phbasler@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:57:29 +0200 Subject: [PATCH] Create Doxygen documentation on PR as artifact (#164) * Split doxygen in two jobs * try test upload * fix name * add checkout action * only upload on push to master --- .github/workflows/doc.yml | 33 ++++++++++++++++++++++++++------- README.md | 2 +- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 99750fc5..127ea929 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -6,7 +6,11 @@ name: Doxygen Deploy on: push: - branches: [ master ] + branches: + - master + pull_request: + branches: + - master concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,7 +18,7 @@ concurrency: jobs: - Deploy: + CreateDocumentation: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -34,9 +38,24 @@ jobs: - run: python3 Setup.py --build-missing - run: cmake --preset conan-linux-x86_64-release - run: cmake --build --preset conan-linux-x86_64-release -j${{ steps.cpu-cores.outputs.count }} -t doc - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.6.3 + - uses: actions/upload-artifact@v4 with: - branch: gh-pages # The branch the action should deploy to. - folder: build/linux-x86_64-release/html # The folder the action should deploy. - target-folder: documentation + path: build/linux-x86_64-release/html + name: documentation + + UploadDocumentation: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: CreateDocumentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: documentation + path: documentation + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4.6.3 + with: + branch: gh-pages # The branch the action should deploy to. + folder: documentation # The folder the action should deploy. + target-folder: documentation diff --git a/README.md b/README.md index f178ace7..8f35a739 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Program: BSMPT version 3.0.7 Released by: Philipp Basler, Lisa Biermann, Margarete Mühlleitner, Jonas Müller, Rui Santos and João Viana -[!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/phbasler/BSMPT/discussions) +[![GitHub Discussions](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/phbasler/BSMPT/discussions) [![Unit tests](https://github.com/phbasler/BSMPT/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/phbasler/BSMPT/actions/workflows/test.yml) [![codecov master](https://codecov.io/gh/phbasler/BSMPT/branch/master/graph/badge.svg?token=LDGNQTADB5)](https://codecov.io/gh/phbasler/BSMPT) [![Documentation](https://img.shields.io/badge/Documentation-master-success)][DoxygenLink]