on master help sign in
Makefile: gh-pages: keep history of gh-branch intact (don't drop)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commit121f6964602d7717185df12c9ecd69387aad1d2d authorMarkus Heiser <markus.heiser@darmarit.de> dateFri 13 Dec 2019, 12:58 (7 years ago) parent04eeeb5
2 files changed+8−5
Makefile+3 utils/makefile.sphinx+5−5
Makefile+3
@@ -2,6 +2,7 @@
22
33export GIT_URL=https://github.com/asciimoo/searx
44export SEARX_URL=https://searx.me
5+export DOCS_URL=https://asciimoo.github.io/searx/
56
67PYOBJECTS = searx
78DOC = docs
@@ -59,6 +60,8 @@ PHONY += docs-live
5960docs-live: pyenvinstall sphinx-live
6061 $(call cmd,sphinx_autobuild,html,docs,docs)
6162
63+$(GH_PAGES)::
64+ @echo "doc available at --> $(DOCS_URL)"
6265
6366# test
6467# ----
utils/makefile.sphinx+5−5
@@ -194,20 +194,20 @@ $(BOOKS_CLEAN):
194194# github pages
195195
196196PHONY += $(GH_PAGES)
197−$(GH_PAGES):
197+$(GH_PAGES)::
198198 $(MAKE) docs
199199 [ -d "gh-pages/.git" ] || git clone $(GIT_URL) gh-pages
200− -cd $(GH_PAGES); git checkout --orphan gh-pages || exit 0
201− rm -rf $(GH_PAGES)/* $(GH_PAGES)/.gitignore
202− touch $(GH_PAGES)/.nojekyll ;\
200+ -cd $(GH_PAGES); git checkout gh-pages >/dev/null
201+ -cd $(GH_PAGES); ls -A | grep -v '.git$$' | xargs rm -rf
203202 cp -r $(DOCS_DIST)/* $(GH_PAGES)/
203+ touch $(GH_PAGES)/.nojekyll
204204 echo "<html><head><META http-equiv='refresh' content='0;URL=index.html'></head></html>" > $(GH_PAGES)/404.html
205− -cd $(GH_PAGES); git push origin :gh-pages
206205 cd $(GH_PAGES);\
207206 git add --all . ;\
208207 git commit -m "gh-pages: updated" ;\
209208 git push origin gh-pages
210209
210+
211211PHONY += docs-clean
212212docs-clean: $(BOOKS_CLEAN)
213213 $(call cmd,sphinx_clean)