Compare commits

..

2 Commits

Author SHA1 Message Date
677ea89517 ci: Allow specifying hugo version 2025-11-09 09:32:32 +01:00
06ba0029b2 fix: update runner
Because of
hugo: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by hugo)
2025-11-09 09:09:56 +01:00

View File

@@ -8,7 +8,7 @@ on:
jobs:
build-and-deploy:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
@@ -22,12 +22,21 @@ jobs:
apt-get update -y
apt-get install -y wget tar jq # Install necessary components
ldd --version
# If a Hugo version is provided in the secrets, use this
# else latest will be used
if [ -n "${{ secrets.HUGO_VERSION }}" ]; then
HUGO_VERSION="${{ secrets.HUGO_VERSION }}"
echo "Using Hugo version from secret: $HUGO_VERSION"
else
# Use the GitHub API to get information about the latest release, then use jq to find out the tag name
latest=$(wget -qO- https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.tag_name')
echo "Latest Hugo version: $latest"
# Use ${latest#v} to strip the v from v1.0.0
HUGO_VERSION=$(wget -qO- https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.tag_name')
echo "Using latest Hugo version: $HUGO_VERSION"
fi
# Use ${HUGO_VERSION#v} to strip the v from v1.0.0
# See "Substring Removal" in https://tldp.org/LDP/abs/html/string-manipulation.html
wget -O hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/${latest}/hugo_extended_${latest#v}_Linux-64bit.tar.gz"
wget -O hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_extended_${HUGO_VERSION#v}_Linux-64bit.tar.gz"
tar -xzf hugo.tar.gz hugo
mv hugo /usr/local/bin/hugo
chmod +x /usr/local/bin/hugo