Skip to content

Commit

Permalink
Update doc-build.yml (pytorch#3071) (pytorch#3099)
Browse files Browse the repository at this point in the history
Summary:
Move noindex logic to the build job

Pull Request resolved: pytorch#3071

Reviewed By: clee2000

Differential Revision: D56218857

Pulled By: svekars

fbshipit-source-id: 69dff489d98eee046d69185a6c03d62fbae37a16
(cherry picked from commit 5d7949d)

Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
  • Loading branch information
pytorchbot and svekars authored Apr 18, 2024
1 parent 59fa8e3 commit 0ad7043
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ jobs:
make html
cd ..
# If it's main branch, add noindex tag to all .html files to exclude from Google Search indexing.
GITHUB_REF=${{ github.ref }}
echo "GitHub Ref: ${GITHUB_REF}"
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
find docs/_build/html/ -name "*.html" -print0 | xargs -0 sed -i '/<head>/a \ \ <meta name="robots" content="noindex">';
fi
cp -rf docs/_build/html/* "${RUNNER_DOCS_DIR}"
mv docs/_build/html "${RUNNER_ARTIFACT_DIR}"
Expand Down

0 comments on commit 0ad7043

Please sign in to comment.