floryn90 / docker-hugo

Truly minimal Docker images for Hugo open-source static site generator.
https://hub.docker.com/r/floryn90/hugo
MIT License
31 stars 1 forks source link

Default 'latest' image uses older release #122

Open metbril opened 4 days ago

metbril commented 4 days ago

I am using the container to build a website with Codeberg CI (woodpecker). Running the container without any specific version should be using the latest, 0.128 at this moment. However, the build logs show that 0.126 is run. Is this a bug or am I missing something?

Repo: https://codeberg.org/r12t/hugo-grotius-v2/

.woodpecker.yml

# hugo.yml
#
# Takes a repository with Hugo source, generates the static site and
# pushes the result to Codeberg pages
#
# Needs a codeberg access token (codeberg_token) as a secret in Woodpecker config
# Also uses another secret (mail) with email address for git config
#
# .domains file in the repository is copied to the output branch so custom domains work
#
# The HUGO_OUTPUT variable must be set to the build output folder configured in Hugo
#

# Exclude page pipeline to be run on "pages" branch
when:
  branch:
    exclude: pages
  event: [push, pull_request]

# Recursive cloning is used to fully clone the themes given as Git submodules
clone:
  git:
    image: woodpeckerci/plugin-git
    settings:
      recursive: true

steps:
  # Build hugo static files
  build:
    image: floryn90/hugo
    environment:
      - HUGO_ENV=production
    commands:
      - hugo --minify
    when:
      event: [pull_request, push]

  publish:
    image: bitnami/git
    # Must be set in Woodpecker configuration
    secrets: [mail, codeberg_token]
    environment:
      - HUGO_OUTPUT=public
    commands:
      # Git configuration
      - git config --global user.email $MAIL
      - git config --global user.name "Woodpecker CI"
      - git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME
      # Copy build step output to repository folder
      - cp -ar $HUGO_OUTPUT/. $CI_REPO_NAME/
      # Needed for custom domains
      - cp .domains $CI_REPO_NAME || true # Ignore if it doesn't exist
      # Commit and push all static files with pipeline started timestamp
      - cd $CI_REPO_NAME
      - git add .
      - git commit -m "Woodpecker CI ${CI_COMMIT_SHA}"
      - git push
    when:
      event: push

Pipeline: https://ci.codeberg.org/repos/13481

Build: https://ci.codeberg.org/repos/13481/pipeline/13/3

Output:

+ hugo --minify
Start building sites … 
hugo v0.126.2-8f3d902ce51512931f5759e9279d93e346c9e649 linux/amd64 BuildDate=2024-05-30T15:19:22Z VendorInfo=gohugoio
                   | EN  
-------------------+-----
  Pages            | 25  
  Paginator pages  |  0  
  Non-page files   |  1  
  Static files     |  1  
  Processed images |  0  
  Aliases          |  0  
  Cleaned          |  0  
Total in 34 ms

Originally posted by @metbril in https://github.com/floryn90/docker-hugo/discussions/121