name: Build
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Setup OCaml
      uses: ocaml/setup-ocaml@v2
      with:
        ocaml-compiler: 5.0
    - name: Use latest ocaml-alsa
      run: git clone https://github.com/savonet/ocaml-alsa.git && opam pin -y add --no-action ocaml-alsa
    - name: Pin locally
      run: opam pin -y add -n .
    - name: Install locally
      run: opam install -y odoc msynth
    - name: Build doc
      run: |
        sudo apt-get install pandoc
        cd doc
        opam exec make
    - name: Deploy doc
      uses: JamesIves/github-pages-deploy-action@v4
      with:
        branch: gh-pages
        folder: doc
