name: Build documentation

on:
  pull_request:
  workflow_call:

jobs:
  build-docs:
    name: Build documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - uses: actions/checkout@v3 # check out this repo
      - uses: actions/checkout@v3
        with:
          repository: bdunderscore/modular-avatar-images
          path: modular-avatar-images
      - name: Install logo assets
        run: |
          cp -Rv modular-avatar-images/img/* docs/static/img

      - name: Build docs
        run: |
          cd docs
          yarn install
          yarn build

      - name: Upload artifact
        uses: actions/upload-artifact@v2
        with:
          name: docs
          path: docs/build