From 3bde9f322ca814f6eff62372f6604e3f7cbfcd09 Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 1 Jun 2025 19:12:37 +0200 Subject: [PATCH] feat: upgrade Hugo installation to use latest extended version from GitHub releases --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1700bce..0abc179 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,18 @@ # Stage 1: Build the Hugo site FROM alpine:3.19 AS builder -# Install Hugo -RUN apk add --no-cache hugo +# Install dependencies +RUN apk add --no-cache wget tar jq curl + +# Install latest Hugo extended version +RUN LATEST_RELEASE=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.tag_name') && \ + VERSION=${LATEST_RELEASE#v} && \ + echo "Installing latest Hugo version: $VERSION" && \ + wget https://github.com/gohugoio/hugo/releases/download/${LATEST_RELEASE}/hugo_extended_${VERSION}_linux-amd64.tar.gz -O hugo.tar.gz && \ + tar -xzf hugo.tar.gz -C /usr/local/bin/ && \ + rm hugo.tar.gz && \ + chmod +x /usr/local/bin/hugo && \ + hugo version # Set the working directory in the container WORKDIR /src