Skip to content
Docker image to build hugo websites
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile
LICENSE
Makefile
README.md

README.md

docker-hugo


Use this image to build your Hugo website as a docker image.

I use this image as my build container on gitlab.com with their built-in CI system.

Sample .gitlab-ci.yml

This is the CI configuration I use to build my Hugo based website. I sync the contents to an Amazon Web Services S3 bucket. Then I've setup Cloudfront to handle SSL in front of the bucket.

image: mapitman/docker-hugo:latest
stages:
  - build
  - deploy
variables:
  GIT_SUBMODULE_STRATEGY: recursive
build:
  stage: build
  script:
  - hugo
  artifacts:
    paths:
    - public

deploy:
  stage: deploy
  script:
  - aws s3 sync ./public/ s3://$AWS_S3_BUCKET/ --acl public-read --delete
  - aws cloudfront create-invalidation --distribution-id $AWS_DIST_ID  --paths "/*"
  only:
  - master
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.