Blog Revamp

It has been about 3 years since I updated this blog last. I have learned a ton in that time and will start writing about some of it here.

Here are some notes about the blog, including some of the things that I did to get it back to deployable shape

Hosting

I am still using firebase hosting to host the blog, but I plan to move to some kind of kubernetes base solution with an nginx docker container soon. I really want to start learning more about GitOps and the lifecycles of applications

Static Site Generator

I am planning on sticking with Hugo. The version was pinned to 0.24, so there was some updating to do since Hugo is now on version 0.72.0. I went ahead and replaced my theme with Soho and did a little custom css work to theme it a bit. I also did some work to put hugo in a docker image with nginx. Below is the multistage dockerfile for my blog

FROM alpine:latest AS build

# get hugo
ARG VERSION=0.72.0
ADD https://github.com/gohugoio/hugo/releases/download/v${VERSION}/hugo_${VERSION}_Linux-64bit.tar.gz /hugo.tar.gz
RUN tar -zxvf hugo.tar.gz
RUN /hugo version

# add git for --enablegitinfo
RUN apk add --no-cache git

# add source files
COPY . /site
WORKDIR /site

# run hugo
RUN HUGO_ENV=production /hugo -v

FROM nginx:1.19-alpine

COPY --from=build /site/public /usr/share/nginx/html

CI

I moved to using Github Actions over CircliCi. My CircleCI config was 3 years old and badly needed updating, so I figured it was a nice time to try something else out. Github Actions has been decent to work with, but I still get the feeling I am not utilizing it 100%. My current config has both a deploy to firebase and the creation of a docker container because I would like to pivot away from Firebase to something else.

Below is my current master branch config

name: Master build
on:
  push:
    branches:
      - 'master'
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout project
        uses: actions/checkout@v2
        with:
          submodules: true  # Fetch Hugo themes
          fetch-depth: 0
      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
      - name: Build
        run: HUGO_ENV=production hugo -v
      - name: Deploy to Firebase
        uses: w9jds/firebase-action@master
        with:
          args: deploy --only hosting
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
      - name: Build and push
        uses: docker/build-push-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
          repository: benjongbloedt/blog
          tag_with_ref: true
          tag_with_sha: true

Furture enhancements

Like I said earlier, I am planning on moving this site away from Firebase and onto a Kubernetes cluster. My current plan is to use FluxCD as a Kubernetes operator to pull in the latest image of the blog and run it. I am leaning to using Digital Ocean’s Managed Kubernetes for my cluster since its seemingly very inexpensive. I have also been playing around with Helm (which is super awesome) and using Traefik as an ingress. Both have pretty decent documentation and tutorials and have been fun to try and pick up.

Kubernetes is 100% overkill for just a blog, but I want to run some other items in the same cluster to play around with Kubernetes and deployment in general.

I will be doing some follow up blog posts on my progress with the migration, and some of the other neat tech I have been working with lately.

Cadence

I am trying to hold myself to publishing multiple posts a week. My two goals here are to use this blog as a kind of public Zettelkasten and secondly, to push myself to keep learning new things.


Thoughts, opinions, or tips on the setup? Feel free to send me a note via the social links.