Skip to content

Commit

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

Pull Request resolved: #3071

Reviewed By: clee2000

Differential Revision: D56218857

Pulled By: svekars

fbshipit-source-id: 69dff489d98eee046d69185a6c03d62fbae37a16
(cherry picked from commit 5d7949d)
  • Loading branch information
svekars authored and pytorchbot committed Apr 17, 2024
1 parent e078e93 commit c2a7782
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 c2a7782

Please sign in to comment.