website-public/Makefile

43 lines
1.1 KiB
Makefile
Raw Normal View History

# flexible use with docker and podman
platform ?= docker
.PHONY: build
build:
# Build Docker image
$(platform) build -t milksad-website .
.PHONY: fullclean
fullclean: clean
$(platform) rmi milksad-website-builder -f
$(platform) image prune --filter label=stage=milksad-website-builder
.PHONY: clean
clean:
rm -r site_export
site_export: build
rm -rf site_export
mkdir -p site_export
$(platform) run milksad-website tar c -C /home/_site . | tar x -C site_export
#.PHONY: serve
#serve: build
# # Run Docker container with listener for current dir and port mapping
# $(platform) run --rm -p 0.0.0.0:4000:80 -it milksad-website
upload: site_export
rsync -av --delete site_export/ milksad-website:/var/www/html
.PHONY: build-dev
build-dev:
# Build Docker image
$(platform) build --target builder -t dev-milksad-website .
.PHONY: dev
dev: build-dev
$(platform) run --rm --expose 4000 -p 127.0.0.1:4000:4000 -v ${PWD}:/home -it dev-milksad-website jekyll serve -H 0.0.0.0
.PHONY: dev-shell
dev-shell: build-dev
$(platform) run --rm --expose 4000 -p 127.0.0.1:4000:4000 -v ${PWD}:/home -it dev-milksad-website sh