As this blog is no longer hosted on GitHub Pages, I needed a quick and lite way to perform continuous deployment on a WEB server.
Available on my new Gitea instance, I thought about webhooks at first.
On the other hand, I didn’t want to deploy a webhook server dedicated to static deployment, nor a CI/CD solution (as Drone) for this specific need.
So this is a short write-up (only) about SSH, BASH scripts and Jekyll usage, if you want to achieve something similar.
Here, I assume that your Gitea instance and your WEB server are running separately.
On the Gitea container
Before anything else, impersonate the
git session and generate a keys pair to allow SSH authentication on the WEB server :
Now you’ll have to add a new hook to your repository settings.
Modify script below to fit your needs, and add it as a
post-receive hook :
On the WEB server
root shell on your WEB server and let’s generate a deploy key for the
www-data session, allowing it to pull from the Gitea repository :
Now you can go to your Gitea repository settings, and add the new deploy key generated :
www-data, you can try your deploy key at this moment :
Finally, you will also need a new script (
Don’t forget to :
Finally, you’ll have to authorize the remote git session (present on the Gitea machine) to execute the script above with a specific argument (
/root/.ssh/authorized_keys), set the public key copied at the first step of this guide :
As always, improvements are welcome below !
And guess what ? This blog post has been automatically deployed