My personal blog, run on DigitalOcean and powered by Ghost.
It's hacky, but it seems to be the easiest way to run ghost locally and maintain the integrity of DigitalOcean's one-click Ghost droplet.
Once you've made changes to the huckleberry
theme and pushed the changes to Github,
you need to copy the changed theme files to the live Ghost directory:
- SSH into the DigitalOcean droplet:
ssh root@DROPLET_IP_ADDRESS
cd ..
cd nickpersico-blog
to go into the Git repository for the blog.- Pull down the latest code you just committed.
- Go back a directory (
cd ..
) - Sync the new theme file changes in the repository with the active Ghost directory:
rsync -r nickpersico-blog/content/themes/huckleberry/* var/www/ghost/content/themes/huckleberry/
After reloading the blog, you should see the updated changes live in production.
- SSH into the DigitalOcean droplet:
ssh root@DROPLET_IP_ADDRESS
cd ..
cd var/www/ghost
service ghost restart
The DigitalOcean droplet is running a cronjob every 30 days at 1:05AM to renew the certificate. --force-renew
ignores the renewal date and forces the renewal to happen.
# Renew SSL certificate via letsencrypt every 30 days at 1:05AM
5 1 30 * * sudo ~/.local/share/letsencrypt/bin/letsencrypt renew --force-renew --pre-hook "service nginx stop" --post-hook "service nginx start"