summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorVilhelm Prytz <vilhelm@prytznet.se>2020-03-01 00:08:51 +0100
committerGitHub <noreply@github.com>2020-03-01 00:08:51 +0100
commit71425a377a447b8743912795d0c8e585b7cedf52 (patch)
tree57a76db7a0a956550c9b27c223adbd42d7767a45 /.github
parent8fcd606500b104b6811ba8a43b145a5df3dfc9d1 (diff)
GitHub Workflow: always use latest version of Hugo (#159)
fetch latest tag (release) from GitHub API as variable download corresponding ".deb" package using latest version variable
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/main.yml4
1 files changed, 3 insertions, 1 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 74df52b..8450880 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -10,7 +10,9 @@ jobs:
- name: Install Hugo
run: |
- wget https://github.com/gohugoio/hugo/releases/download/v0.60.1/hugo_extended_0.60.1_Linux-64bit.deb -O /tmp/hugo.deb
+ LATEST_VERSION=`curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
+ VERSION_NO_PREFIX=`echo $LATEST_VERSION | cut -c 2-`
+ wget "https://github.com/gohugoio/hugo/releases/download/$LATEST_VERSION/hugo_extended_${VERSION_NO_PREFIX}_Linux-64bit.deb" -O /tmp/hugo.deb
sudo dpkg -i /tmp/hugo.deb
- name: Run Hugo