name: CI Docs
on:
  push:
    branches:
      - main
  pull_request_target:
jobs:
  docs-build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        if: github.event_name == 'push'
        with:
          ref: ${{ github.head_ref || github.ref_name }}
      - uses: actions/checkout@v3
        if: github.event_name == 'pull_request_target'
        with:
          ref: "refs/pull/${{ github.event.number }}/merge"
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: "18"
      - name: Docs / Install Dependencies
        run: cd docs && yarn
      - name: Docs / Build Documentation
        run: cd docs && yarn build
