Add new html build

This commit is contained in:
Wojciech Kozlowski 2019-07-28 18:52:37 +02:00
parent 0caeafb3be
commit c141ec1eb7
4 changed files with 55 additions and 1 deletions

View File

@ -19,6 +19,11 @@ after_script:
tags:
- docker
html:
extends: .builds
script:
- make html
proxy:
extends: .builds
script:

View File

@ -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

View File

@ -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
# ---------------------------------------------------------------------------

24
html/Dockerfile Normal file
View File

@ -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