{"id":17224021,"url":"https://github.com/alombarte/hugo-docker","last_synced_at":"2025-04-11T20:41:00.753Z","repository":{"id":146805581,"uuid":"151704106","full_name":"alombarte/hugo-docker","owner":"alombarte","description":"Alpine container with hugo, ssh and git to build projects","archived":false,"fork":false,"pushed_at":"2024-07-23T12:58:23.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T16:27:41.636Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alombarte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-05T10:20:25.000Z","updated_at":"2024-07-23T12:58:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"db0ea967-bfe4-4bbf-bbbf-32ac65c6d32e","html_url":"https://github.com/alombarte/hugo-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alombarte%2Fhugo-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alombarte%2Fhugo-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alombarte%2Fhugo-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alombarte%2Fhugo-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alombarte","download_url":"https://codeload.github.com/alombarte/hugo-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248478684,"owners_count":21110747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T04:09:49.802Z","updated_at":"2025-04-11T20:41:00.719Z","avatar_url":"https://github.com/alombarte.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hugo docker\n\nAn alpine docker image with hugo, node (for pipeline functionality), openssh and git. Used in my CI pipelines.\n\nIt comes without the `hugo` entrypoint.\n\nUsage\n-----\n\nTo build your hugo site in the default `public` directory:\n\n\tdocker run -v \"${PWD}:/site\" alombarte/hugo hugo\n\n## Use a different hugo version\n\nAvailable versions are [here](https://hub.docker.com/r/alombarte/hugo/tags). To add another version just build the image passing the desired version, e.g.:\n\n    export VERSION=0.55.6 \u0026\u0026 docker build -t alombarte/hugo:${VERSION} --build-arg VERSION=${VERSION} .\n\n## Integration on Gitlab and Github\nThe following file is an example on how to build a hugo site hosetd on a private repo (Gitlab) and deploy it into a public Github repo (the generated HTML). Yes, you could the whole thing on Gitlab :)\n\nMake sure to set the variables in the configuration:\n\n- $USERNAME\n- $REPOSITORY\n- $EMAIL\n- $GH_TOKEN (the token provided by github so you can push without your password)\n\n\n```\nimage: alombarte/hugo\n\nstages:\n  - build\n  - deploy\nservices:\n  - docker:dind\n\n# If you need special NPM builds that cannot be handled through Hugo:\nbuild:\n  stage: build\n  image: docker:stable\n  script:\n    - docker run -v $PWD:/app -w /app node:10 npm install\n    - docker run -v $PWD:/app -w /app node:10 npm run-script build\n  artifacts:\n    paths:\n    - static/dist/\n  only:\n    - master\n\ndeploy:\n  stage: deploy\n# variables:\n#    GIT_SUBMODULE_STRATEGY: normal\n#    GIT_DEPTH: \"3\"\n  dependencies:\n    - build\n  script:\n    - git clone https://github.com/${USERNAME}/${REPOSITORY}.git public\n    - rm -fr public/*\n    - hugo -d public\n    - cd public\n    - git remote rm origin\n    - git remote add origin https://${USERNAME}:${GH_TOKEN}@github.com/${USERNAME}/${REPOSITORY}.net.git\n    - git config --global user.email \"${EMAIL}\"\n    - git config --global user.name \"${USERNAME}\"\n    - git add -A\n    - git commit -m \"Automatic build from CI $CI_SERVER_NAME $CI_PIPELINE_ID\"\n    - git push --set-upstream origin master\n  artifacts:\n    paths:\n    - public\n  only:\n    - master\n  before_script:\n    - hugo version\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falombarte%2Fhugo-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falombarte%2Fhugo-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falombarte%2Fhugo-docker/lists"}