Update Hugo version default to latest in gh-pages workflow

This commit is contained in:
Aditya Telange
2026-04-11 14:14:10 +05:30
parent c17406565e
commit 67f02cdc85
+8 -2
View File
@@ -15,7 +15,7 @@ on:
hugoVersion: hugoVersion:
description: "Hugo Version" description: "Hugo Version"
required: false required: false
default: "0.146.0" default: "latest"
# Allow one concurrent deployment # Allow one concurrent deployment
concurrency: concurrency:
@@ -34,8 +34,14 @@ jobs:
contents: read contents: read
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: ${{ github.event.inputs.hugoVersion || '0.146.0' }} HUGO_VERSION: ${{ github.event.inputs.hugoVersion || 'latest' }}
steps: steps:
- name: Resolve Hugo version
run: |
if [ "${HUGO_VERSION}" = "latest" ]; then
HUGO_VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep '"tag_name"' | sed 's/.*"v\([^"]*\)".*/\1/')
echo "HUGO_VERSION=${HUGO_VERSION}" >> $GITHUB_ENV
fi
- name: Install Hugo CLI - name: Install Hugo CLI
run: | run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \