From 121f6964602d7717185df12c9ecd69387aad1d2d Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 13 Dec 2019 12:58:46 +0100 Subject: [PATCH] Makefile: gh-pages: keep history of gh-branch intact (don't drop) Signed-off-by: Markus Heiser --- Makefile | 3 +++ utils/makefile.sphinx | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 28b7c58ce..cf5e5e636 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ export GIT_URL=https://github.com/asciimoo/searx export SEARX_URL=https://searx.me +export DOCS_URL=https://asciimoo.github.io/searx/ PYOBJECTS = searx DOC = docs @@ -59,6 +60,8 @@ PHONY += docs-live docs-live: pyenvinstall sphinx-live $(call cmd,sphinx_autobuild,html,docs,docs) +$(GH_PAGES):: + @echo "doc available at --> $(DOCS_URL)" # test # ---- diff --git a/utils/makefile.sphinx b/utils/makefile.sphinx index 01181ff27..5cbc5ebdd 100644 --- a/utils/makefile.sphinx +++ b/utils/makefile.sphinx @@ -194,20 +194,20 @@ $(BOOKS_CLEAN): # github pages PHONY += $(GH_PAGES) -$(GH_PAGES): +$(GH_PAGES):: $(MAKE) docs [ -d "gh-pages/.git" ] || git clone $(GIT_URL) gh-pages - -cd $(GH_PAGES); git checkout --orphan gh-pages || exit 0 - rm -rf $(GH_PAGES)/* $(GH_PAGES)/.gitignore - touch $(GH_PAGES)/.nojekyll ;\ + -cd $(GH_PAGES); git checkout gh-pages >/dev/null + -cd $(GH_PAGES); ls -A | grep -v '.git$$' | xargs rm -rf cp -r $(DOCS_DIST)/* $(GH_PAGES)/ + touch $(GH_PAGES)/.nojekyll echo "" > $(GH_PAGES)/404.html - -cd $(GH_PAGES); git push origin :gh-pages cd $(GH_PAGES);\ git add --all . ;\ git commit -m "gh-pages: updated" ;\ git push origin gh-pages + PHONY += docs-clean docs-clean: $(BOOKS_CLEAN) $(call cmd,sphinx_clean)