Skip to content

Commit 28b4b3a

Browse files
authored
Fix PR doc build from forks (#350)
1 parent d95534d commit 28b4b3a

File tree

2 files changed

+22
-27
lines changed

2 files changed

+22
-27
lines changed

.github/workflows/build_pr_documentation.yml

+6-27
Original file line numberDiff line numberDiff line change
@@ -43,37 +43,16 @@ jobs:
4343
make doc BUILD_DIR=intel-doc-build VERSION=pr_$PR_NUMBER COMMIT_SHA_SUBPACKAGE=$COMMIT_SHA CLONE_URL=$PR_CLONE_URL
4444
cd ..
4545
46-
- name: Push to repositories
46+
- name: Save commit_sha & pr_number
4747
run: |
4848
cd optimum-intel
4949
sudo chmod -R ugo+rwx intel-doc-build
5050
cd intel-doc-build
5151
sudo mv optimum.intel optimum-intel
52-
doc-builder push optimum-intel --doc_build_repo_id "hf-doc-build/doc-build-dev" --token "${{ secrets.HF_DOC_BUILD_PUSH }}" --commit_msg "Updated with commit $COMMIT_SHA See: https://github.com/huggingface/optimum-intel/commit/$COMMIT_SHA" --n_retries 5
53-
shell: bash
52+
echo ${{ env.COMMIT_SHA }} > ./commit_sha
53+
echo ${{ env.PR_NUMBER }} > ./pr_number
5454
55-
- name: Find doc comment
56-
uses: peter-evans/find-comment@v2
57-
id: find_comment
55+
- uses: actions/upload-artifact@v3
5856
with:
59-
issue-number: ${{ env.PR_NUMBER }}
60-
body-includes: docs for this PR
61-
62-
- name: Add doc comment if not present
63-
uses: thollander/actions-comment-pull-request@v2
64-
if: steps.find_comment.outputs.comment-id == ''
65-
66-
with:
67-
message: 'The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/optimum-intel/pr_${{ env.PR_NUMBER }}). All of your documentation changes will be reflected on that endpoint.'
68-
pr_number: ${{ env.PR_NUMBER }}
69-
GITHUB_TOKEN: ${{ secrets.COMMENT_BOT_TOKEN }}
70-
71-
- name: Update doc comment if necessary
72-
if: github.event.action == 'reopened' && steps.find_comment.outputs.comment-id != ''
73-
uses: peter-evans/create-or-update-comment@v1
74-
with:
75-
comment-id: ${{ steps.find_comment.outputs.comment-id }}
76-
token: ${{ secrets.COMMENT_BOT_TOKEN }}
77-
edit-mode: replace
78-
body: |
79-
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/optimum-intel/pr_${{ env.PR_NUMBER }}). All of your documentation changes will be reflected on that endpoint.
57+
name: doc-build-artifact
58+
path: optimum-intel/intel-doc-build/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Upload PR Documentation
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build PR Documentation"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
build:
11+
uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main
12+
with:
13+
package_name: optimum-intel
14+
secrets:
15+
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
16+
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}

0 commit comments

Comments
 (0)