From 01ceb98da1faafdec296adeb453a6f4c4c1426c7 Mon Sep 17 00:00:00 2001 From: Aymeric Date: Mon, 30 Dec 2024 00:39:26 +0100 Subject: [PATCH] Add doc build workflows --- .github/workflows/build_documentation.yml | 25 +++++++++++++++++++ .github/workflows/build_pr_documentation.yml | 22 ++++++++++++++++ .github/workflows/upload_pr_documentation.yml | 16 ++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 .github/workflows/build_documentation.yml create mode 100644 .github/workflows/build_pr_documentation.yml create mode 100644 .github/workflows/upload_pr_documentation.yml diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml new file mode 100644 index 0000000..78f70b8 --- /dev/null +++ b/.github/workflows/build_documentation.yml @@ -0,0 +1,25 @@ +name: Build documentation + +on: + push: + branches: + - main + - doc-builder* + - v*-release + - use_templates + paths: + - 'docs/source/**' + - 'assets/**' + - '.github/workflows/doc-build.yml' + +jobs: + build: + uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main + with: + commit_sha: ${{ github.sha }} + package: smolagents + languages: en + # additional_args: --not_python_module # use this arg if repository is documentation only + secrets: + token: ${{ secrets.HUGGINGFACE_PUSH }} + hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} \ No newline at end of file diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml new file mode 100644 index 0000000..4f6eec3 --- /dev/null +++ b/.github/workflows/build_pr_documentation.yml @@ -0,0 +1,22 @@ +name: Build PR Documentation + +on: + pull_request: + paths: + - 'docs/source/**' + - 'assets/**' + - '.github/workflows/doc-pr-build.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main + with: + commit_sha: ${{ github.event.pull_request.head.sha }} + pr_number: ${{ github.event.number }} + package: smolagents + languages: en + # additional_args: --not_python_module # use this arg if repository is documentation only \ No newline at end of file diff --git a/.github/workflows/upload_pr_documentation.yml b/.github/workflows/upload_pr_documentation.yml new file mode 100644 index 0000000..94f8008 --- /dev/null +++ b/.github/workflows/upload_pr_documentation.yml @@ -0,0 +1,16 @@ +name: Upload PR Documentation + +on: + workflow_run: + workflows: ["Build PR Documentation"] + types: + - completed + +jobs: + build: + uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main + with: + package_name: smolagents + secrets: + hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} + comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }} \ No newline at end of file