Skip to content

Commit 49b51b8

Browse files
datapythonistajreback
authored andcommitted
DOC: Not pushing the docs to github pages in PRs (#24316)
1 parent 122edfc commit 49b51b8

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

ci/build_docs.sh

+27-22
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,33 @@ if [ "$DOC" ]; then
2525
echo # Create and send docs #
2626
echo ########################
2727

28-
cd build/html
29-
git config --global user.email "[email protected]"
30-
git config --global user.name "pandas-docs-bot"
31-
32-
# create the repo
33-
git init
34-
35-
touch README
36-
git add README
37-
git commit -m "Initial commit" --allow-empty
38-
git branch gh-pages
39-
git checkout gh-pages
40-
touch .nojekyll
41-
git add --all .
42-
git commit -m "Version" --allow-empty
43-
44-
git remote remove origin
45-
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
46-
git fetch origin
47-
git remote -v
48-
49-
git push origin gh-pages -f
28+
echo "Only uploading docs when TRAVIS_PULL_REQUEST is 'false'"
29+
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
30+
31+
if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
32+
cd build/html
33+
git config --global user.email "[email protected]"
34+
git config --global user.name "pandas-docs-bot"
35+
36+
# create the repo
37+
git init
38+
39+
touch README
40+
git add README
41+
git commit -m "Initial commit" --allow-empty
42+
git branch gh-pages
43+
git checkout gh-pages
44+
touch .nojekyll
45+
git add --all .
46+
git commit -m "Version" --allow-empty
47+
48+
git remote remove origin
49+
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
50+
git fetch origin
51+
git remote -v
52+
53+
git push origin gh-pages -f
54+
fi
5055
fi
5156

5257
exit 0

0 commit comments

Comments
 (0)