Skip to content

Commit 5e7e7d6

Browse files
committed
make buildable with actions/jekyll-build-pages container
1 parent 16d1902 commit 5e7e7d6

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@ html:
1717
clean:
1818
rm -rf target
1919

20-
jekyll-build:
20+
jekyll-build-prepare:
2121
mkdir -p $(JEKYLL_WORKDIR)
2222
cp target/html/doc/*.html $(JEKYLL_WORKDIR)
2323
cp -Ru src/* $(JEKYLL_WORKDIR)
24+
25+
jekyll-build: jekyll-build-prepare
2426
jekyll build -s $(JEKYLL_WORKDIR) -d $(JEKYLL_OUTDIR)
2527

28+
jekyll-build-by-docker: jekyll-build-prepare
29+
./tools/docker_jekyll jekyll build -s $(JEKYLL_WORKDIR) -d $(JEKYLL_OUTDIR)
30+
2631
jekyll-clean:
2732
rm -rf $(JEKYLL_WORKDIR) $(JEKYLL_OUTDIR)
2833

29-
.PHONY: jekyll-build jekyll-clean
34+
.PHONY: jekyll-build-prepare jekyll-build jekyll-build-by-docker jekyll-clean

tools/docker_jekyll

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
#
3+
# This uses GitHub Container Registry.
4+
# So you need to login ghcr.io with Personal Access Token which have scope read:packages at least.
5+
#
6+
# Example:
7+
#
8+
# cat | docker login ghcr.io -u USERNAME --password-stdin
9+
# (type your PAT and Ctrl-D twice)
10+
11+
set -eu
12+
13+
dir="$(pwd)"
14+
15+
case $(uname -s) in
16+
MSYS*) dir=$(cygpath -w $dir) ;;
17+
esac
18+
19+
docker run --rm -it \
20+
--workdir //srv/jekyll \
21+
-v "${dir}:/srv/jekyll" \
22+
-p 4000:4000 \
23+
--entrypoint "" \
24+
ghcr.io/actions/jekyll-build-pages:v1.0.13 \
25+
"$@"

0 commit comments

Comments
 (0)