name: Build documentation

on:
  push:
    branches:
      - main
      - doc-builder*
      - v*-release
      - v*-patch
    paths:
      - "src/diffusers/**.py"
      - "examples/**"
      - "docs/**"

permissions:
  contents: read

jobs:
  build:
    uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@e60a538eea9817ab312196d0d233604b01697265  # main
    with:
      commit_sha: ${{ github.sha }}
      install_libgl1: true
      package: diffusers
      notebook_folder: diffusers_doc
      languages: en ko zh ja pt
      pre_command: uv pip uninstall transformers huggingface_hub && UV_PRERELEASE=allow uv pip install -U transformers@git+https://github.com/huggingface/transformers.git
    secrets:
      token: ${{ secrets.HUGGINGFACE_PUSH }}
      hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
