khuedoan-homelab/apps/blog/deployment.yaml
2021-12-19 23:34:58 +07:00

49 lines
1015 B
YAML

# TESTING
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: blog
name: blog
spec:
replicas: 3
selector:
matchLabels:
app: blog
template:
metadata:
labels:
app: blog
spec:
containers:
- name: nginx
image: nginx:latest
volumeMounts:
- mountPath: /usr/share/nginx/html
name: static
- name: build
image: alpine:latest
workingDir: /usr/local/src
command:
- /bin/sh
- -c
args:
- |
apk add git go hugo
git clone https://github.com/khuedoan/blog .
while true; do
hugo --minify --destination /usr/share/nginx/html
sleep 120
git pull
done
volumeMounts:
- mountPath: /usr/local/src
name: source
- mountPath: /usr/share/nginx/html
name: static
volumes:
- name: source
emptyDir: {}
- name: static
emptyDir: {}