From 1999a07241a45467e3f2dda6af96a9f655d06f0b Mon Sep 17 00:00:00 2001 From: Sebastian Krysmanski Date: Tue, 20 Feb 2024 17:12:30 +0100 Subject: [PATCH] Add support for use of old Hugo versions --- .github/workflows/build-and-deploy.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy.yaml b/.github/workflows/build-and-deploy.yaml index 63ef0c8..2fcc95c 100644 --- a/.github/workflows/build-and-deploy.yaml +++ b/.github/workflows/build-and-deploy.yaml @@ -49,10 +49,23 @@ jobs: # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on runs-on: ubuntu-latest + # Use this to pin the Hugo version, if necessary. + env: + HUGO_VERSION: 0.122.0 + steps: - - name: Install Hugo CLI + - name: Install Hugo CLI (latest) + if: ${{ !env.HUGO_VERSION }} run: sudo snap install hugo + - name: Install Hugo CLI (specific) + if: ${{ env.HUGO_VERSION }} + # NOTE: "snap" doesn't support installing old versions, if they're not provided by the package authors. + # This snippet is taken from: https://gohugo.io/hosting-and-deployment/hosting-on-github/ + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb + sudo dpkg -i ${{ runner.temp }}/hugo.deb + # See: https://github.com/actions/setup-node - name: Setup NodeJS environment uses: actions/setup-node@v4