Hi everyone,
Referencing:
I’ve attempted to setup my deployment pipeline with using Circle CI, GitHub, AWS S3, and AWS CloudFront.
My issue: Circle CI is listing my builds as “successful”, but no pages are being generated in my S3 bucket, save three pieces of “Categories”-related content:
/categories/index.html
/categories/index.xml
/categories/page/1/index.html
I don’t use any taxonomies in my project—compounding the strangeness.
My static files are all being successfully generated (css, img, etc.) in my S3 bucket.
Here’s my .circleci/config.yml
file:
version: 2
jobs:
build:
docker:
- image: cibuilds/hugo:latest
working_directory: ~/hugo
environment:
HUGO_BUILD_DIR: ~/hugo/public
steps:
- run: apk update && apk add git
- checkout
- run: git submodule sync && git submodule update --init
- run: curl -L https://github.com/bep/s3deploy/releases/download/v2.3.0/s3deploy_2.3.0_Linux-64bit.tar.gz | tar xvz
- run: HUGO_ENV=production hugo -v -d $HUGO_BUILD_DIR
- run: htmlproofer $HUGO_BUILD_DIR --allow-hash-href --check-html --empty-alt-ignore --disable-external
- deploy:
name: deploy
command: |
if [ "${CIRCLE_BRANCH}" = "master" ]; then
./s3deploy -source=$HUGO_BUILD_DIR -region=us-east-2 -bucket=mybucketname -distribution-id=_____MyID_____
else
echo "Not master branch, dry run only"
fi
Here’s a snapshot of what Hugo generates when it’s running locally:
| EN
+------------------+----+
Pages | 78
Paginator pages | 1
Non-page files | 1
Static files | 88
Processed images | 0
Aliases | 4
Sitemaps | 1
Cleaned | 0
And here’s my log from Circle CI on the run: HUGO_ENV=production hugo -v -d $HUGO_BUILD_DIR
command:
#!/bin/bash -eo pipefail
HUGO_ENV=production hugo -v -d $HUGO_BUILD_DIR
INFO 2019/01/31 18:29:52 No translation bundle found for default language "en"
INFO 2019/01/31 18:29:52 Translation func for language en not found, use default.
INFO 2019/01/31 18:29:52 i18n not initialized; if you need string translations, check that you have a bundle in /i18n that matches the site language or the default language.
INFO 2019/01/31 18:29:52 Using config file:
Building sites … INFO 2019/01/31 18:29:52 syncing static files to /root/hugo/~/hugo/public/
INFO 2019/01/31 18:29:52 Alias "/tags/page/1/index.html" translated to "tags/page/1/index.html"
INFO 2019/01/31 18:29:52 Alias "/categories/page/1/index.html" translated to "categories/page/1/index.html"
INFO 2019/01/31 18:29:52 Found no layout for "404", language "en", output format "HTML": create a template below /layouts with one of these filenames: 404.html
| EN
+------------------+----+
Pages | 6
Paginator pages | 0
Non-page files | 0
Static files | 83
Processed images | 0
Aliases | 2
Sitemaps | 1
Cleaned | 0
Total in 26 ms
htmlproofer $HUGO_BUILD_DIR --allow-hash-href --check-html --empty-alt-ignore --disable-external00:00
Exit code: 0
#!/bin/bash -eo pipefail
htmlproofer $HUGO_BUILD_DIR --allow-hash-href --check-html --empty-alt-ignore --disable-external
Running ["ScriptCheck", "ImageCheck", "LinkCheck", "HtmlCheck"] on ["~/hugo/public"] on *.html...
Ran on 5 files!
HTML-Proofer finished successfully.
deploy
Please note that none of my 78 pages are generating.
I’m totally unfamiliar with backend processes and, as such, most of what i’ve done here is rote copying and pasting and hoping for the best. (For example, i don’t understand the purpose of the working_directory
in my .circleci/config.yml
file and if i should be changing this to something else for my use case.). I’m sorry to paste so much into this post. Rest assured i’ve got more to paste, if need be.
This may be way out of the scope of Hugo support, but i appreciate any thoughts anyone may be willing to share.