From fc10789c9c11b983931e4cf837e2c15296b9ad85 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 31 Aug 2023 02:29:50 +0000 Subject: [PATCH] Add 'CI/CD' --- Dockerfile | 8 ++++++++ Makefile | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e961be5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM klakegg/hugo as build + +WORKDIR /src +COPY . /src/ +RUN hugo + +FROM nginx +COPY --from=build /src/public /usr/share/nginx/html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4136058 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +DOCKER_IMAGE := cr.annabunches.net/freyjaskiss-static +DOCKER_TAG := latest + +.PHONY: all build push + +all: serve + +serve: + hugo serve -D --bind 0.0.0.0 -b http://${DEV_IP}:1313/ + +build: + # TODO: figure out why this always uses the cache on the last step... + docker build --no-cache -t ${DOCKER_IMAGE}:${DOCKER_TAG} . + +push: + docker push ${DOCKER_IMAGE}:${DOCKER_TAG}