name: Build documentation

on:
  push:
    branches:
      - main
      - doc-builder*
      - v*-release
      - v*-patch

jobs:
  build:
    steps:
      - name: Install dependencies
        run: |
          apt-get update && apt-get install libsndfile1-dev libgl1 -y

      - name: Build doc
        uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main
        with:
          commit_sha: ${{ github.sha }}
          package: diffusers
          notebook_folder: diffusers_doc
          languages: en ko zh

    secrets:
      token: ${{ secrets.HUGGINGFACE_PUSH }}
      hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
