Below you will find pages that utilize the taxonomy term “Hugo”
configure hugo with CD ( continuous deployment ) on AWS Amplify
background
by default, to update the hugo generated site, it expects :
- local new build ;
- push that whole newly built
/build
dir to repo ; - AWS amplify git clone for deployment ;
this also implies to make small changes / updates in github via the web interface will not have the new changes reflected online.
the updated amplify config file
the build setting is therefore updated as :
- add
.gitignore
or update the existing file to avoid/build
; - include
amplify.yml
in the repo ( or via the web dashboard inside AWS amplify ) ; - update the content of
amplify.yml
as the followings :
---
version: 1
env:
variables:
# always AVOID the prefix "v" !!
# update this accordingly to the latest / desired version
HUGO_VER: 0.139.3
# define the file to download and the path to it
HUGO_TAR: hugo_extended_"${HUGO_VER}"_Linux-64bit.tar.gz
DOWNLOAD_PREFIX: https://github.com/gohugoio/hugo/releases/download
# beware of the "v" in front of the version here
DOWNLOAD_PATH: "${DOWNLOAD_PREFIX}/v${HUGO_VER}"
frontend:
phases:
preBuild:
commands:
- sudo mkdir -p /public
- sudo dnf update -y
- wget "${DOWNLOAD_PATH}"/"$HUGO_TAR"
- tar -zxvf "${HUGO_TAR}"
- sudo mv hugo /usr/local/bin/
- /usr/local/bin/hugo version # verify the hugo version to be used
build:
commands:
# make sure the version downloaded above is used with absolute path
- /usr/local/bin/hugo -F --minify
artifacts:
baseDirectory: /public
files:
- '**/*'
cache:
paths: []
some notes on the above yaml file
- as of 2024-12-02, the theme
ananke
was used, which requires the latest version of hugo, or at least not working with the version of hugo came with the default build image in AWS Amplify (AWS Linux 2023
) ; - the version of hugo came with the default build image is
v0.12x.x
( something like that ) ; - an absolute path to the freshly downloaded hugo executable must be specified in the build command to make sure it won’t use the default version ;
- the command / keyword
build
has to be removed in the build command above ~
hosting hugo created site on AWS amplify
overview
the hugo official guidelines regarding hosting on AWS amplify is slightly confusing or unclear at best, and some additional notes are given below.
additional note to step 3 in the section “Hosting”
The very tiny and unclear screen capture attached there shows baseDirectory: /public
, which never occur in the apps I just built yesterday ( 2024-11-30 ), none of them carry that so-called “detection”, which means you must add that yourself.
building and deployment notes on the new jimz.cc
updates as of 2024-12-02
this site is now being generated via hugo instead. the following info are only kept for future reference.
overview
some notes on scaffolding this site when following the official instructions.
some background info
this site used to be built with gatsby, even thought the built site is fast in response and have endless possibilites by adding plugins, it is still too heavy and bulky at the back ( a basic starter takes too much time to start, and too much dependencies to deal with ), at least to me and in my use case which i don’t really need that much interactivities, and even if i did need them, in my next project i’d probably be building it with Fresh.