diff --git a/README.md b/README.md index 08fce59..9dbea46 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Grids currently supported: - regular lat lon - HealPIX -* Documentation: +* Documentation: * GitHub: ## Install diff --git a/docs/push_docs.sh b/docs/push_docs.sh index 251efc4..9441892 100755 --- a/docs/push_docs.sh +++ b/docs/push_docs.sh @@ -1,14 +1,22 @@ #!/bin/bash +set -ex + +make docs + originalBranch=$(git rev-parse --abbrev-ref HEAD) # Function to switch back to the original branch -function switchBack { - echo "Switching back to $originalBranch" - git checkout $originalBranch +function cleanup { + echo "Cleaning up worktree" + git worktree remove --force /tmp/earth2grid-pages } -git checkout pages -trap switchBack EXIT -rm -r public/ && cp -r docs/_build/html public -git add -f public/ -git commit -a -m "update doc from $ref" -git push origin pages +git worktree add pages /tmp/earth2grid-pages +trap cleanup EXIT + +rsync -av --delete --exclude ".git" docs/_build/html/ /tmp/earth2grid-pages/ +touch /tmp/earth2grid-pages/.nojekyll + +cd /tmp/earth2grid-pages +git add -A +git commit -m "update doc from $ref" +echo "To update the website: git push origin pages"