Deploy the ./bin/deploy
to your server, then you need to add the deployment key, as following.
You may want to trigger the script manually or by webhook (require additional setup which not cover in this repo).
This script will deploy based on latest tagged. It won't deploy to any non-tagged. Run the follow command as root user.
TLDR, create deployment keys:
$ ssh-keygen -t ed25519 -C "[email protected]"
> Enter a file in which to save the key (/Users/you/.ssh/id_algorithm):
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]
$ eval "$(ssh-agent -s)"
$ ssh-add -k /Users/you/.ssh/id_algorithm
$ cat /Users/you/.ssh/id_algorithm.pub
Copy the output then add key in Deploy Keys
References:
- https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
- https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
Deploy it anywhere in your server, then run:
sudo su
. ./deploy