HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.29k stars 2.91k forks source link

Automatic build deployment using wercker #77

Closed pat-s closed 7 years ago

pat-s commented 7 years ago

Referring to https://georgecushen.com/create-your-website-with-hugo/ - Automatic deployment

How do I need to adjust wercker.yml so that it will succeed for me? I just took yours from hugo-academic-demo and commented out the fingerprint.

Website repo: https://github.com/pat-s/Website Website.io: https://pat-s.github.io

Build fails with

Submodule 'public' (https://github.com/pat-s/pat-s.github.io.git) registered for path 'public'
No submodule mapping found in .gitmodules for path 'themes/academic
gcushen commented 7 years ago

I've had a very quick look, so I could be wrong, but it looks like perhaps you used git clone ... to get the themes/academic path and tried to commit the contents of the parent directory to Github. In this case, Git won't upload your local themes/academic folder because it contains another Git repository (so it ignores it).

You'll probably want to remove themes/academic folder and do something like git submodule add https://github.com/gcushen/hugo-academic.git themes/academic so that it gets added as a Git submodule of your main website repository. Alternatively you can just remove the .git folder within themes/academic if you don't plan to use Git to update the Academic theme in the future (and then you should be able to commit/upload your themes/academic path).

pat-s commented 7 years ago

Thanks! This helped me fixing the initialize and update git submodules step - now I´m stuck in the hugo build step - link.

I will dig into it - so far I only have experience with Travis CI and appveyor but not with wercker.

As wercker is optional I don't want to bother you too much with that. However, automatic website rebuilding is a must have in my opinion - so I guess its worth it! If I have a working setup I´ll share it with you.

gcushen commented 7 years ago

It would be nice to get it running on a more popular/established CI platform, but Wrecker is the CI recommended by Hugo and seems to currently offer the most integrated approach. Let me know if you have any success building with other CIs :)

Regarding your link, it gives 401 - Unauthorized so I can't see the build issue. The Hugo Forums have a lot of people discussing Wrecker, so a search there may also help.

pat-s commented 7 years ago

I just set the wercker repo to public - so the link to the build should work now! Sure, I will get back to you! Thanks for all your work so far!

pat-s commented 7 years ago

So I have a working Wercker setup using the "double repo" option. Wercker automatically builds the site (https://pat-s.github.io) based on the hosting repo (https://github.com/pat-s/pat-s.github.io) on a Push to to the master branch of the blog source (https://github.com/pat-s/Website).

Probably worth a single blog post as you already intended to do in your getting-started.md post. Including how to

box: golang:latest

build:
  steps:
    - script:
        name: initialize and update git submodules
        code: |
            git submodule init
            git submodule update --remote --recursive
    - arjen/hugo-build:
        version: "HEAD"
        theme: academic

deploy:
  steps:
    - install-packages:
            packages: git
    - leipert/git-push:
            gh_oauth: $GIT_TOKEN
            repo: pat-s/pat-s.github.io
            branch: master
            basedir: public
gcushen commented 7 years ago

Good to hear that you got Wercker working nicely and thanks for sharing your setup.

My Hugo blog post was getting a bit long and I was unsure if there would be much interest in Wercker. Since there's some interest now, I'll try to make a detailed post about Wercker 😃