From 40e62b7c85ab99f3c076a88a504fad45faa78154 Mon Sep 17 00:00:00 2001 From: Mishig Date: Fri, 9 Jun 2023 11:23:55 +0200 Subject: [PATCH] [doc build] Use secrets (#1501) --- .github/workflows/build_documentation.yaml | 3 ++- .github/workflows/delete_doc_comment.yaml | 14 +++++++------- .../workflows/delete_doc_comment_trigger.yaml | 12 ++++++++++++ .github/workflows/upload_pr_documentation.yaml | 16 ++++++++++++++++ 4 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/delete_doc_comment_trigger.yaml create mode 100644 .github/workflows/upload_pr_documentation.yaml diff --git a/.github/workflows/build_documentation.yaml b/.github/workflows/build_documentation.yaml index 5036b2bea1..3f6671df71 100644 --- a/.github/workflows/build_documentation.yaml +++ b/.github/workflows/build_documentation.yaml @@ -14,4 +14,5 @@ jobs: commit_sha: ${{ github.sha }} package: huggingface_hub secrets: - token: ${{ secrets.HUGGINGFACE_PUSH }} \ No newline at end of file + token: ${{ secrets.HUGGINGFACE_PUSH }} + hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} \ No newline at end of file diff --git a/.github/workflows/delete_doc_comment.yaml b/.github/workflows/delete_doc_comment.yaml index c9bb3fcf46..72801c856e 100644 --- a/.github/workflows/delete_doc_comment.yaml +++ b/.github/workflows/delete_doc_comment.yaml @@ -1,13 +1,13 @@ -name: Delete dev documentation +name: Delete doc comment on: - pull_request: - types: [ closed ] - + workflow_run: + workflows: ["Delete doc comment trigger"] + types: + - completed jobs: delete: uses: huggingface/doc-builder/.github/workflows/delete_doc_comment.yml@main - with: - pr_number: ${{ github.event.number }} - package: huggingface_hub \ No newline at end of file + secrets: + comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/delete_doc_comment_trigger.yaml b/.github/workflows/delete_doc_comment_trigger.yaml new file mode 100644 index 0000000000..5e39e25397 --- /dev/null +++ b/.github/workflows/delete_doc_comment_trigger.yaml @@ -0,0 +1,12 @@ +name: Delete doc comment trigger + +on: + pull_request: + types: [ closed ] + + +jobs: + delete: + uses: huggingface/doc-builder/.github/workflows/delete_doc_comment_trigger.yml@main + with: + pr_number: ${{ github.event.number }} \ No newline at end of file diff --git a/.github/workflows/upload_pr_documentation.yaml b/.github/workflows/upload_pr_documentation.yaml new file mode 100644 index 0000000000..5699fb805f --- /dev/null +++ b/.github/workflows/upload_pr_documentation.yaml @@ -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: huggingface_hub + secrets: + hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} + comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }} \ No newline at end of file