Gh-pages will not refresh after CircleCI build and deploy



I have a python package with documentation built by sphinx, and a gh-pages branch setup for github pages. I have a script that when run locally will publish my changes without issue. At the end of a CircleCI test cycle the script runs without errors but the changes will not show in the actual page. The changes are however shown in index.html of the gh-pages branch.


  1. Make changes locally.
  2. ./
  3. Verify changes <- They appear
  4. Make changes, push to github, have CircleCI run test
  5. CircleCI runs ./
  6. index.html on gh-branch reflects changes. Website does not host new index.html

My deploy script:


set -e

git checkout gh-pages
git pull --unshallow origin gh-pages

git reset --hard origin/$CIRCLE_BRANCH

sphinx-apidoc -o docs/source dslib
sphinx-build docs/source .

git add -A
git commit -m "Deploy to GitHub pages $CIRCLE_SHA1 [ci skip]"
git push -f origin gh-pages

Why are the gh-pages not being updated after being pushed to gh-pages from CircleCI?