Fix build_documentation CI (#15803)

This commit is contained in:
Eliott C 2022-02-23 21:53:51 +01:00 committed by GitHub
parent a0e3480699
commit 6336017c15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 18 deletions

View File

@ -110,14 +110,14 @@ jobs:
- name: Make documentation
run: |
cd doc-builder
doc-builder build transformers ../transformers/docs/source --build_dir ../doc-build-dev --notebook_dir notebooks/transformers_doc --clean --version pr_$PR_NUMBER --html
cd doc-builder &&
doc-builder build transformers ../transformers/docs/source --build_dir ../doc-build-dev --notebook_dir notebooks/transformers_doc --clean --version pr_$PR_NUMBER --html &&
cd ..
- name: Push to repositories
run: |
cd doc-build-dev
ls
git add .
git commit -m "Updated with commit ${{ github.sha }} See: https://github.com/huggingface/transformers/commit/${{ github.sha }}"
cd doc-build-dev &&
ls &&
git add . &&
git commit -m "Updated with commit ${{ github.sha }} See: https://github.com/huggingface/transformers/commit/${{ github.sha }}" &&
git push origin main

View File

@ -86,28 +86,30 @@ jobs:
- name: Make documentation
run: |
cd doc-builder
doc-builder build transformers ../transformers/docs/source --build_dir ../doc-build --notebook_dir notebooks/transformers_doc --clean --html
cd doc-builder &&
doc-builder build transformers ../transformers/docs/source --build_dir ../doc-build --notebook_dir notebooks/transformers_doc --clean --html &&
cd ..
env:
NODE_OPTIONS: --max-old-space-size=6656
- name: Push to repositories
run: |
cd doc-build
if [[ `git status --porcelain` ]]; then
git add .
git commit -m "Updated with commit ${{ github.sha }} \n\nSee: https://github.com/huggingface/transformers/commit/${{ github.sha }}"
cd doc-build &&
if [[ `git status --porcelain` ]]; then
git add . &&
git commit -m "Updated with commit ${{ github.sha }} \n\nSee: https://github.com/huggingface/transformers/commit/${{ github.sha }}" &&
git push origin main
else
echo "No diff in the documentation."
fi
cd ..
fi &&
cd .. &&
cd notebooks
cd notebooks &&
if [[ `git status --porcelain` ]]; then
git add transformers_doc
git commit -m "Updated Transformer doc notebooks with commit ${{ github.sha }} \n\nSee: https://github.com/huggingface/transformers/commit/${{ github.sha }}"
git add transformers_doc &&
git commit -m "Updated Transformer doc notebooks with commit ${{ github.sha }} \n\nSee: https://github.com/huggingface/transformers/commit/${{ github.sha }}" &&
git push origin master
else
echo "No diff in the notebooks."
fi
fi &&
cd ..