This repository contains scripts for a Push-to-deploy system implemented with a VPS.
-
- Run the install.sh script on your server, this will install everything you need and generate secure passwords for PostgreSQL
cd ~
wget https://raw.githubusercontent.com/skoshx/push/master/install.sh
bash install.sh
-
- Change your .ssh/config file, this will make you able to push to your remote repository with public key authentication.
Host (ip / domain)
HostName (ip / domain)
IdentityFile ~/.ssh/id_rsa (path to private key)
IdentitiesOnly yes
-
- Run
project-create.sh
on VPS
- Run
-
- Add project as remote
# Add server repo as remote called "deploy"
git remote add deploy ssh://<your-name>@<your-ip>/srv/git/<your-app>.git/
-
- Push to deploy!
# Push & deploy
git push deploy main
These push to scripts assume you are using a GitHub repository as a main repository, and thus
assumes your default branch is called "main" instead of "master". If you have a repository with
the default branch being called "master" you need to change this in your post-receive
Git hook.
vim /srv/git/<your project>/hooks/post-receive
# replace this line:
git --work-tree=$TMP --git-dir=$GIT checkout -f main
# with this:
git --work-tree=$TMP --git-gir=$GIT checkout -f
- Self host Plausible? (https://plausible.io/docs/self-hosting#1-clone-the-hosting-repo)