-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
49 lines (39 loc) · 1.31 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
include ./makefile-utils/*.mk
.DEFAULT_GOAL := help
GH_PAGE_IMAGE=ghcr.io/adoyle-h/jekyll-build-pages:v1.0.7-ad-7
# 本地编辑与浏览(不用先执行 make build,会自动构建,支持热更新)
.PHONY: serve
serve:
echo "You should press 'ctrl-c' when \"Auto-regeneration: enabled for '/src/site'\" appeared."
docker run -it --rm -p 4000:4000 -v "${PWD}:/src/site" ${GH_PAGE_IMAGE}
.PHONY: readme-update
readme-update:
@node ./_doc_builder/update-readme.mjs
.PHONY: meta-update
meta-update:
@node ./_doc_builder/update-meta.mjs
# 本地构建
.PHONY: build
build:
docker run -it --rm -v "${PWD}:/src/site" ${GH_PAGE_IMAGE} \
build --verbose
.PHONY: build-gh
build-gh:
docker run -it --rm -v "${PWD}:/src/site" --entrypoint github-pages ${GH_PAGE_IMAGE} \
build --verbose
sh:
docker run -it --rm -p 4000:4000 --entrypoint sh -v "${PWD}:/src/site" ${GH_PAGE_IMAGE}
# 本地浏览(要先执行 make build)
.PHONY: http
http:
docker run --rm -it -p 4000:80 \
-v "${PWD}/_doc_builder/Caddyfile:/etc/caddy/Caddyfile" \
-v "${PWD}/_site:/usr/share/caddy:ro" caddy:2.6.3-alpine
.PHONY: debug-gh-pages
debug-gh-pages:
docker run -it --rm -p 4000:4000 -v "${PWD}:/src/site" \
--entrypoint bash -w /src/site \
${GH_PAGE_IMAGE}
.PHONY: clean-index-md
clean-index-md:
fd '^index.md' ./*/ | xargs rm -i