Skip to content

Commit

Permalink
WIP on pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dlesbre committed Apr 17, 2024
1 parent ab57e7e commit 51fce97
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ocaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,43 @@ jobs:

- name: Run unit tests
run: opam exec -- dune test

- name: Build documentation
run: |
opam install odoc
opam exec -- dune build @doc
- id: vars
shell: bash
run: echo "##[set-output name=ref;]$(echo ${GITHUB_REF#refs/heads/})"

- uses: actions/upload-artifact@v2
with:
name: doc-${{ steps.vars.outputs.ref }}
path: _build/default/_doc/_html/

doc:
needs: build
if: github.event_name == 'push' &&
( github.ref == 'refs/heads/main' || startsWith(github.ref,'refs/tags') )

runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Remove previous doc
run: rm -rf ${{ needs.build.outputs.ref }}
- name: Retrieve new documentation
uses: actions/download-artifact@v2
with:
name: doc-${{ needs.build.outputs.ref }}
path: ${{ needs.build.outputs.ref }}
- name: Deploy documentation
run: |
git config user.email "${{ github.actor }}@users.noreply.github.com"
git config user.name "${{ github.actor }}"
git add ${{ needs.build-all.outputs.ref }}
git commit -m "Deploy ${GITHUB_SHA}"
git push -f "https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git" gh-pages

0 comments on commit 51fce97

Please sign in to comment.