Makefile: add "publish-book" target
See https://github.com/rust-lang/mdBook/blob/master/book-example/src/continuous-integration.md#deploying-to-github-pages-manually
This commit is contained in:
parent
2e5db5b698
commit
43679bd04f
21
Makefile
21
Makefile
|
@ -48,7 +48,11 @@ TOOLS_CSV := $(subst $(SPACE),$(COMMA),$(TOOLS))
|
|||
clean-testnet1 \
|
||||
testnet1 \
|
||||
clean \
|
||||
libbacktrace
|
||||
libbacktrace \
|
||||
schlesi \
|
||||
schlesi-dev \
|
||||
book \
|
||||
publish-book
|
||||
|
||||
ifeq ($(NIM_PARAMS),)
|
||||
# "variables.mk" was not included, so we update the submodules.
|
||||
|
@ -153,5 +157,20 @@ libnfuzz.a: | build deps
|
|||
$(ENV_SCRIPT) nim c -d:release --app:staticlib --noMain --nimcache:nimcache/libnfuzz_static -o:build/$@ $(NIM_PARAMS) nfuzz/libnfuzz.nim && \
|
||||
[[ -e "$@" ]] && mv "$@" build/ # workaround for https://github.com/nim-lang/Nim/issues/12745
|
||||
|
||||
book:
|
||||
cd docs && \
|
||||
mdbook build
|
||||
|
||||
publish-book: | book
|
||||
git worktree add tmp-book gh-pages && \
|
||||
rm -rf tmp-book/* && \
|
||||
cp -a docs/book/* tmp-book/ && \
|
||||
cd tmp-book && \
|
||||
git add . && \
|
||||
git commit -m "make publish-book" && \
|
||||
git push origin gh-pages && \
|
||||
git worktree remove -f tmp-book && \
|
||||
rm -rf tmp-book
|
||||
|
||||
endif # "variables.mk" was not included
|
||||
|
||||
|
|
|
@ -354,6 +354,12 @@ make -j$(nproc) NIMFLAGS="-d:release" USE_MULTITAIL=yes eth2_network_simulation
|
|||
make USE_LIBBACKTRACE=0 # expect the resulting binaries to be 2-3 times slower
|
||||
```
|
||||
|
||||
- publish a book using [mdBook](https://github.com/rust-lang/mdBook) from sources in "docs/" to GitHub pages:
|
||||
|
||||
```bash
|
||||
make publish-book
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Licensed and distributed under either of
|
||||
|
|
|
@ -1 +1 @@
|
|||
book
|
||||
/book
|
||||
|
|
Loading…
Reference in New Issue