diff --git a/.github/workflows/doxygen-gh-pages.yml b/.github/workflows/doxygen-gh-pages.yml index 4e2e90c..5f2b48c 100644 --- a/.github/workflows/doxygen-gh-pages.yml +++ b/.github/workflows/doxygen-gh-pages.yml @@ -1,22 +1,17 @@ -# This is a basic workflow to help you get started with Actions - name: Doxygen Action -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + branches: + - dev # Trigger on push to 'dev' branch + - main # Trigger on push to 'main' branch # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + doxy-build: runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job @@ -31,11 +26,35 @@ jobs: doxyfile-path: "./Doxyfile" # default is ./Doxyfile # Working directory working-directory: "." # default is . + - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - # Default Doxyfile build documentation to html directory. - # Change the directory if changes in Doxyfile - publish_dir: ./html + + deploy-main: + if: github.ref == 'refs/heads/main' # Only deploy on 'main' branch + runs-on: ubuntu-latest + needs: doxy-build + + steps: + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # Default Doxyfile build documentation to html directory. + # Change the directory if changes in Doxyfile + publish_dir: ./html + publish_branch: gh-pages + + deploy-dev: + if: github.ref == 'refs/heads/dev' # Only deploy on 'dev' branch + runs-on: ubuntu-latest + needs: doxy-build + + steps: + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # Default Doxyfile build documentation to html directory. + # Change the directory if changes in Doxyfile + publish_dir: ./html + publish_branch: gh-pages-dev # Specify the target branch (gh-pages-dev in this case)