-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (19 loc) · 709 Bytes
/
Makefile
File metadata and controls
25 lines (19 loc) · 709 Bytes
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
.PHONY: build-docker build serve dev test clean
# Build the Docker image
build-docker:
docker build -t jekyll-site .
# Run jekyll build to generate _site
build: build-docker
docker run --rm jekyll-site bundle exec jekyll build
# Run the container to serve the site locally with nginx
serve: build
docker run --rm -p 8888:80 -v $$(pwd)/_site:/usr/share/nginx/html:ro nginx:alpine
# Run with live reloading (mount local directory)
dev: build-docker
docker run --rm -p 4000:4000 -v $$(pwd):/site jekyll-site bundle exec jekyll serve --host 0.0.0.0 --force_polling
# Test the build (matches CI)
test: build
@echo "Site build successful!"
# Clean up Docker images
clean:
docker rmi jekyll-site || true