name: Doxygen build

on:
  pull_request:
    types: [closed]

jobs:
  build_docs:
    if: github.event.pull_request.merged == true
    name: Build & Deploy Docs
    runs-on: ubuntu-20.04
    permissions:
      contents: write
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          path: zscilib

      - name: Deploy      
        uses: DenverCoder1/doxygen-github-pages-action@v1.1.0
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: gh-pages
          folder: doxygen/html
          config_file: doc/Doxyfile