Skip to content

Upgrade dunolint workflow #191

Upgrade dunolint workflow

Upgrade dunolint workflow #191

Workflow file for this run

name: deploy-doc
on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
permissions:
contents: read
jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
env:
OCAML_VERSION: "5.3"
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 24
cache: npm
cache-dependency-path: doc/package-lock.json
- name: Install Docusaurus Dependencies
working-directory: ./doc
run: npm ci --ignore-scripts
- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace-${{ env.OCAML_VERSION }}" >> "$GITHUB_ENV"
- name: Setup Dune
uses: mbarbin/setup-dune@ae2985bcdedc6fb24e5743d6f9dace9cf262b41c # v2.0.0+patch-4
with:
version: "3.21.0"
workspace: ${{ env.DUNE_WORKSPACE }}
cache-prefix: "main-ci-${{ env.OCAML_VERSION }}"
cache-readonly: true
steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts
- name: Build Odoc Pages
run: dune build @doc
- name: Copy Odoc Pages to Docusaurus Static Directory
run: |
rm -rf doc/static/odoc
cp -R _build/default/_doc/_html doc/static/odoc
- name: Build Website
working-directory: ./doc
run: npm run build
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: doc/build
deploy:
name: Deploy to GitHub Pages
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./doc
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5