apiVersion: apps/v1
kind: Deployment
metadata:
  name: blog
spec:
  replicas: 1
  selector:
    matchLabels:
      name: blog
  template:
    metadata:
      labels:
        name: blog
    spec:
      containers:
      - name: git-sync
        image: registry.k8s.io/git-sync:v3.1.3
        volumeMounts:
        - name: markdown
          mountPath: /tmp/git
        env:
        - name: GITSYNC_REPO
          value: https://github.com/kubernetes/git-sync.git
        - name: GITSYNC_LINK
          value: git-sync
      - name: hugo
        image: registry.k8s.io/hugo
        volumeMounts:
        - name: markdown
          mountPath: /src
        - name: html
          mountPath: /dest
        env:
        - name: HUGO_SRC
          value: /src/git-sync/demo/blog
        - name: HUGO_BUILD_DRAFT
          value: "true"
        - name: HUGO_BASE_URL
          value: example.com
      - name: nginx
        image: nginx
        volumeMounts:
        - name: html
          mountPath: /usr/share/nginx/html
      volumes:
      - name: markdown
        emptyDir: {}
      - name: html
        emptyDir: {}
