name: deploy-doc
on:
  push:
    branches:
      - master
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: checkout-code
        uses: actions/checkout@v3
      - name: setup-ocaml
        uses: ocaml/setup-ocaml@v2
        with:
          ocaml-compiler: 4.14.0
      - name: setup
        run: |
             opam pin add . -y --no-action
             opam depext -y geneweb
             opam install -y ./*.opam --deps-only --with-doc
      - name: build
        run: |
             opam exec -- ocaml ./configure.ml
             opam exec -- make doc
      - name: deploy
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          branch: gh-pages # The branch the action should deploy to.
          folder: _build/default/_doc/_html # The folder the action should deploy.
