hugo-book-theme/.github/workflows/main.yml
Vilhelm Prytz 71425a377a
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
2020-03-01 00:08:51 +01:00

20 lines
673 B
YAML

name: Build with Hugo
on: [push]
jobs:
hugo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Hugo
run: |
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
working-directory: exampleSite
run: hugo --themesDir ../..