Easily deploy static sites created using Hugo to any cloud instance of choice!
(currently supports debian based servers only like Ubuntu and it's derivatives, Kali Linux, Raspbian,etc)
- Create a cloud instance and assign it your system's public SSH key (generally stored in ~/.ssh/id_rsa.pb)
- Copy the public ssh key of this droplet to the GitHub account which has the contents for the site. (if the content is stored in local, it is advised to store it in Github as a repository).
- Install Ansible on your machine. On Mac, you can install ansible using its brew package manager-
brew install ansible
cd
into the cloned repo i.ecloudhack/
then add executable permission todeploy.sh
andconf<OS>
by runningchmod +x deploy.sh
andchmod +x confLinux
../conf<OS> -ip <ip> -repo <repo-url>
egconfMac -ip <ip> -repo <repo-url>
on Mac../deploy.sh
P.S: Make sure port 80 of this server is open in the firewall setting and is not busy.
Your Hugo powered static site is now available at http://<ip-address>
I followed this article to assign a custom domain name (souvikhaldar.info in my case) to the given IP address. If you have already assigned the IP to your domain name, you can provide the domain name in the ip
flag to conf
. I've used Digital Ocean's droplet, but you can use any cloud service provider of choice. Hope this automation tool helped you deploy your site easily to the cloud of your choice.
Link to youtube video for easy demonstration https://youtu.be/Op3M1PBSQL4