diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000..a66a0d1e --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,45 @@ +name: github pages + +on: + push: + branches: + - main # Set a branch name to trigger deployment + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + + - uses: avsm/setup-ocaml@v1 + with: + ocaml-version: '4.11.1' + + - name: cache opam + id: cache-opam + uses: actions/cache@v2 + with: + path: _opam + key: opam-ubuntu-latest-4.11.1 + + - name: Pin + run: opam pin -n . + if: steps.cache-opam.outputs.cache-hit != 'true' + + - name: Depext + run: opam depext -yt containers containers-data containers-thread + if: steps.cache-opam.outputs.cache-hit != 'true' + + - name: Deps + run: opam install -d . --deps-only + if: steps.cache-opam.outputs.cache-hit != 'true' + + - name: Build + run: opam exec -- dune build @doc + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/default/_doc/_html/ + destination_dir: dev