Skip to content

Posts tagged gitolite

Posts under this tag. Back to all posts when you want the full stream.

@latest_post

How to set up automatic Hugo website generation and deployment with Git

Let's say that you have tried Hugo,  you liked it, and made a website with it.
Now you are ready to deploy that website for the whole world to see.

Wouldn't it be great if you could just do:

git add .
git commit -m "Updated blog content"
git push

And be done with it?

Well, if that sounds like your kind of thing; something you'd like to have...
Then read on my friend!


Inventory

What do you need for this tutorial?

  • A public server somewhere. If you don't have one, you can get a VPS (Virtual Private Server) from Linode , DigitalOcean  or similar providers.
  • An account with access to sudo.
  • You have git available, from this guide. 
  • You use Gitolite to manage your repositories, from this guide. 
  • A configured webserver ---I recommend looking into NGINX , since it's super easy to setup in Ubuntu.

Let's assume:

  1. A local ~/.ssh/config file with this content:

    ~/.ssh/config
    Host git-server
    # This is the IP for your VPS
    HostName 111.111.111.111
    Port 22
    # This is the remote user
    User yolo
    Host web-server
    # This is the IP for your other VPS
    HostName 222.222.222.222
    Port 22
    # This is the remote user
    User webcustomer
  2. You have your Hugo project versioned with git and you can push code to the remote repository.

  3. The repository's name is yolo-web, so you can clone it like this:

    git clone git@git-server:yolo-web

Writing stream

1 older posts tagged gitolite.