Skip to content

Commit dcb5bb1

Browse files
committed
Add auto fetching latest hugo version
1 parent a403576 commit dcb5bb1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ jobs:
2828

2929
- name: Setup Hugo
3030
run: |
31-
curl -L -o /tmp/hugo.tar.gz 'https://github.com/gohugoio/hugo/releases/download/v0.161.1/hugo_extended_0.161.1_linux-amd64.tar.gz'
31+
LATEST_TAG=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
32+
VERSION=${LATEST_TAG#v}
33+
echo "Using Hugo release $LATEST_TAG (version $VERSION)"
34+
curl -L -o /tmp/hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/${LATEST_TAG}/hugo_extended_${VERSION}_linux-amd64.tar.gz"
3235
tar -C ${RUNNER_TEMP} -zxvf /tmp/hugo.tar.gz hugo
3336
- name: Build
3437
run: ${RUNNER_TEMP}/hugo

0 commit comments

Comments
 (0)