on master help sign in
[fix] Makefile target gh-pages & flatten history of branch gh.pages

1. This patch fixes error: rm -rf gh-pages/ make V=1 gh-pages make[1]: Leaving directory '/800GBPCIex4/share/searx' [ -d "gh-pages/.git" ] || git clone gh-pages fatal: repository 'gh-pages' does not exist 2. The gh-page build has been moved to ./build/gh-pages this also affects 'travis-gh-pages' 3. The gh-pages commit messages now includes a ref to the repository and commit 4. Since a gh-pages history has only the drawback that the reposetory grows fast, this patch also flattens the history: cd build/gh-pages/; git log --oneline bash: cd: build/gh-pages/: Datei oder Verzeichnis nicht gefunden 026126be (HEAD -> gh-pages, origin/gh-pages) make gh-pages: from https://github.com/return42/searx.git@71d66979c2935312e0aed7fc7c3cf6199fbe88a2 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commit40d2a116e1e5a24027bba54de530fa9d4700cef3 authorMarkus Heiser <markus.heiser@darmarit.de> dateFri 29 Jan 2021, 11:41 (6 years ago) parent71d6697
2 files changed+13−15
.github/workflows/integration.yml+1−1 utils/makefile.sphinx+12−14
.github/workflows/integration.yml+1−1
@@ -80,7 +80,7 @@ jobs:
8080 with:
8181 GITHUB_TOKEN: ${{ github.token }}
8282 BRANCH: gh-pages
83− FOLDER: gh-pages
83+ FOLDER: build/gh-pages
8484 CLEAN: true # Automatically remove deleted files from the deploy branch
8585
8686 dockers:
utils/makefile.sphinx+12−14
@@ -10,7 +10,7 @@ SPHINX_CONF ?= conf.py
1010DOCS_FOLDER = ./docs
1111DOCS_BUILD = ./$(LXC_ENV_FOLDER)build/docs
1212DOCS_DIST = ./$(LXC_ENV_FOLDER)dist/docs
13−GH_PAGES ?= gh-pages
13+GH_PAGES ?= build/gh-pages
1414
1515BOOKS_FOLDER = ./docs
1616BOOKS_DIST = ./$(LXC_ENV_FOLDER)dist/books
@@ -172,24 +172,22 @@ PHONY += prepare-gh-pages
172172prepare-gh-pages:
173173 cp -r $(DOCS_DIST)/* $(GH_PAGES)/
174174 touch $(GH_PAGES)/.nojekyll
175− echo "<html><head><META http-equiv='refresh' content='0;URL=index.html'></head></html>" > $(GH_PAGES)/404.html
176−
177−PHONY += $(GH_PAGES)
178−$(GH_PAGES)::
179− $(MAKE) docs
180− [ -d "gh-pages/.git" ] || git clone $(GIT_URL) gh-pages
181− -cd $(GH_PAGES); git checkout gh-pages >/dev/null
182− -cd $(GH_PAGES); git pull
183− -cd $(GH_PAGES); ls -A | grep -v '.git$$' | xargs rm -rf
175+ echo "<html><head><META http-equiv='refresh' content='0;URL=index.html'></head></html>" > $(GH_PAGES)/404.html
176+
177+PHONY += gh-pages
178+gh-pages: docs-clean docs
179+ - git worktree remove -f $(GH_PAGES) || exit 0
180+ - git branch -D gh-pages || exit 0
181+ git worktree add --no-checkout $(GH_PAGES) master
182+ cd $(GH_PAGES); git checkout --orphan gh-pages && git rm -rfq .
184183 $(MAKE) prepare-gh-pages
185184 cd $(GH_PAGES);\
186185 git add --all . ;\
187− git commit -m "gh-pages: updated" ;\
188− git push origin gh-pages
186+ git commit -q -m "make gh-pages: from $(shell git config --get remote.origin.url)@$(shell git rev-parse HEAD)" ;\
187+ git push -f origin gh-pages
189188
190189PHONY += travis-gh-pages
191−travis-gh-pages:
192− $(MAKE) docs
190+travis-gh-pages: docs-clean docs
193191 rm -Rf $(GH_PAGES)
194192 mkdir -p $(GH_PAGES)
195193 $(MAKE) prepare-gh-pages