Skip to content

Commit

Permalink
Switch workflow to pinned Hugo version
Browse files Browse the repository at this point in the history
  • Loading branch information
skrysmanski committed Feb 23, 2024
1 parent 7ce3bd4 commit bc0c106
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ 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:
# The Hugo version to use: https://github.com/gohugoio/hugo/releases
# NOTE: It sometimes happens that new Hugo versions break the site. So I've decided to always
# "pin" the Hugo version (instead of using the latest version). This way, the Hugo version
# can be updated with a pull request where I can test the new version.
HUGO_VERSION: 0.122.0

steps:
- 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/
- name: Install Hugo CLI
# This snippet is taken from: https://gohugo.io/hosting-and-deployment/hosting-on-github/
# NOTE: We can't use "snap" for this as it doesn't support installing old versions, if they're not provided by the package authors.
# Note, though, that this call is extremely fast (way faster than using snap), most likely because the source is also hosted
# by 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
Expand Down

0 comments on commit bc0c106

Please sign in to comment.