diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 75529bb44b8..5a895c04a00 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -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 '/
/a \ \ '; + fi + cp -rf docs/_build/html/* "${RUNNER_DOCS_DIR}" mv docs/_build/html "${RUNNER_ARTIFACT_DIR}" @@ -91,13 +98,6 @@ jobs: REF_TYPE=${{ github.ref_type }} REF_NAME=${{ github.ref_name }} - # If it's main branch, add noindex tag to all .html files to exclude from Google Search indexing. - REF_NAME=$(echo "${{ github.ref }}") - echo "Ref name: ${REF_NAME}" - if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then - find docs -name "*.html" -print0 | xargs -0 sed -i '//a \ \ '; - fi - # If building for a release tag, branch, set the branch/tag name # as the target folder in the gh-pages branch. The artifacts created # during the build will be copied over to the target dir in the