update GH Actions to publish on OCaml 5.4 (#228) #70
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: check and deploy docs and playground | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags-ignore: | |
| - 'v*' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: yarn | |
| - uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: 5.4.0 | |
| dune-cache: false # can cause trouble when generating melange docs in step below: https://github.com/ocaml/dune/issues/7720 | |
| - name: Install all deps | |
| run: make install | |
| - name: Generate melange library docs for OCaml syntax | |
| run: make pull-melange-docs SYNTAX=ml | |
| - name: Generate melange library docs for Reason syntax | |
| run: make pull-melange-docs SYNTAX=re | |
| - name: Run canonical script | |
| run: opam exec -- dune exec add_canonical docs/public/api | |
| - name: Check Reason syntax | |
| run: make check-reason | |
| - name: Check extracted code blocks | |
| run: make check-extracted-code-blocks | |
| - name: Run tests | |
| run: make test | |
| - name: Build site (and playground) | |
| run: make build-site | |
| - name: Configure Git user | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| - name: Fetch and checkout gh-pages | |
| run: | | |
| git fetch origin gh-pages --depth=1 | |
| git checkout gh-pages | |
| - name: Copy published site into folder | |
| run: cp -TRv docs/.vitepress/dist/ unstable/ | |
| - name: Add unstable files to git index | |
| run: git add unstable | |
| - name: Committing | |
| run: git commit -m 'Deployed ${{ github.sha }} to unstable' | |
| - name: Push | |
| run: git push |