Chang's blog
learn and share...
How to Publish a Hugo Project to Remote Server Automatically?

A pipeline for blogging automatically though Github

Purpose

write and serve markdown blog without caring about the html, theme, archiving, server, website, domain …

What to Build? (Workflow)

Local repo
    ↓
Github repo
    ↓
Webhook
    ↓
Server repo
    ↓
Caddy hook
    ↓
Hugo build
    ↓
Caddy serve

Step by Step Examples

  1. generate a new hugo project

    # build a hugo site
    hugo new MyBlog
    # theme
    # git submodule
    # write the markdown file
    # vim content/posts/xxx.md
    
  2. server side

    install hugo, go, caddy

  3. github side

    webhook


Last modified on 2020-02-21