|
| 1 | +name: deploy-odoc |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + # Review gh actions docs if you want to further define triggers, paths, etc |
| 8 | + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + name: Build OCaml Doc |
| 13 | + runs-on: ubuntu-latest |
| 14 | + defaults: |
| 15 | + run: |
| 16 | + shell: bash |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + |
| 23 | + - name: Setup OCaml |
| 24 | + uses: ocaml/setup-ocaml@v3 |
| 25 | + with: |
| 26 | + ocaml-compiler: "5.3.x" |
| 27 | + opam-repositories: | |
| 28 | + default: https://github.com/ocaml/opam-repository.git |
| 29 | + mbarbin: https://github.com/mbarbin/opam-repository.git |
| 30 | +# janestreet-bleeding: https://github.com/janestreet/opam-repository.git |
| 31 | +# janestreet-bleeding-external: https://github.com/janestreet/opam-repository.git#external-packages |
| 32 | + |
| 33 | + - name: Install OCaml Dependencies |
| 34 | + run: opam install . --deps-only --with-doc |
| 35 | + |
| 36 | + - name: Build Odoc Pages |
| 37 | + run: opam exec -- dune build @doc |
| 38 | + |
| 39 | + - name: Upload Build Artifact |
| 40 | + uses: actions/upload-pages-artifact@v3 |
| 41 | + with: |
| 42 | + path: _build/default/_doc/_html |
| 43 | + |
| 44 | + deploy: |
| 45 | + name: Deploy to GitHub Pages |
| 46 | + needs: build |
| 47 | + |
| 48 | + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment |
| 49 | + permissions: |
| 50 | + pages: write # to deploy to Pages |
| 51 | + id-token: write # to verify the deployment originates from an appropriate source |
| 52 | + |
| 53 | + # Deploy to the github-pages environment |
| 54 | + environment: |
| 55 | + name: github-pages |
| 56 | + url: ${{ steps.deployment.outputs.page_url }} |
| 57 | + |
| 58 | + runs-on: ubuntu-latest |
| 59 | + defaults: |
| 60 | + run: |
| 61 | + shell: bash |
| 62 | + # working-directory: ./doc |
| 63 | + steps: |
| 64 | + - name: Deploy to GitHub Pages |
| 65 | + id: deployment |
| 66 | + uses: actions/deploy-pages@v4 |
0 commit comments