File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 68
68
make html
69
69
cd ..
70
70
71
+ # If it's main branch, add noindex tag to all .html files to exclude from Google Search indexing.
72
+ echo "Ref name: ${REF_NAME}"
73
+ if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
74
+ find docs/_build/html/ -name "*.html" -print0 | xargs -0 sed -i '/<head>/a \ \ <meta name="robots" content="noindex">';
75
+ fi
76
+
71
77
cp -rf docs/_build/html/* "${RUNNER_DOCS_DIR}"
72
78
73
79
mv docs/_build/html "${RUNNER_ARTIFACT_DIR}"
91
97
REF_TYPE=${{ github.ref_type }}
92
98
REF_NAME=${{ github.ref_name }}
93
99
94
- # If it's main branch, add noindex tag to all .html files to exclude from Google Search indexing.
95
- REF_NAME=$(echo "${{ github.ref }}")
96
- echo "Ref name: ${REF_NAME}"
97
- if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
98
- find docs -name "*.html" -print0 | xargs -0 sed -i '/<head>/a \ \ <meta name="robots" content="noindex">';
99
- fi
100
-
101
100
# If building for a release tag, branch, set the branch/tag name
102
101
# as the target folder in the gh-pages branch. The artifacts created
103
102
# during the build will be copied over to the target dir in the
You can’t perform that action at this time.
0 commit comments