diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 32b33df..c587f20 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,11 @@ after_script: tags: - docker +html: + extends: .builds + script: + - make html + proxy: extends: .builds script: diff --git a/Makefile b/Makefile index a03726c..0ae2fc5 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,26 @@ DOCKER_REGISTRY = registry.wojciechkozlowski.eu/wojtek/loki default: all +# ----------------------------------------------------------------------------- +# html +# ----------------------------------------------------------------------------- + +HTML = $(DOCKER_REGISTRY)/html + +html-clean: + docker rmi $(HTML) || /bin/true + +html-build: + docker build -f html/Dockerfile -t $(HTML) ./html + +html-push: + docker push $(HTML) + +html-pull: + docker pull $(HTML) + +html: html-clean html-build html-push + # ----------------------------------------------------------------------------- # proxy # ----------------------------------------------------------------------------- @@ -93,21 +113,25 @@ clean-all: docker image prune -a -f clean-builds: \ + html-clean \ proxy-clean \ wiki-clean \ nextcloud-clean build-all: \ + html-build \ proxy-build \ wiki-build \ nextcloud-build push-all: \ + html-push \ proxy-push \ wiki-push \ nextcloud-push pull-all: \ + html-pull \ proxy-pull \ wiki-pull \ nextcloud-pull diff --git a/docker-compose.yml b/docker-compose.yml index 871ffff..1fabca4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,8 @@ services: html: container_name: html - image: registry.wojciechkozlowski.eu/wojtek/wojciechkozlowski.eu/image + build: html + image: registry.wojciechkozlowski.eu/wojtek/loki/html restart: always # --------------------------------------------------------------------------- diff --git a/html/Dockerfile b/html/Dockerfile new file mode 100644 index 0000000..1c6efac --- /dev/null +++ b/html/Dockerfile @@ -0,0 +1,24 @@ +FROM nginx + +# Update +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && apt-get -y upgrade + +RUN \ + # Install pre-requisites + apt-get -y install wget git && \ + wget https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_extended_0.56.0_Linux-64bit.deb && \ + dpkg -i hugo_extended_0.56.0_Linux-64bit.deb && \ + rm hugo_extended_0.56.0_Linux-64bit.deb && \ + + # Fetch the website code, build and deploy + git clone --recursive https://gitlab.wojciechkozlowski.eu/wojtek/wojciechkozlowski.eu.git && \ + cd wojciechkozlowski.eu && \ + hugo && \ + cp -r public/* /usr/share/nginx/html && \ + + # Clean up + cd .. && \ + rm -rf wojciechkozlowski.eu && \ + apt-get -y purge hugo git wget && \ + apt-get -y autoremove