Simple code for automatic deploy of your application on your linux-server. It pulls latest updates from your github repo and restarts your application.
python3
python3-pip
git
Clone the repo at the directory that should contain the repo you want to deploy.
git clone https://github.com/va1ngvarr/autodeploy
Edit config at autodeploy/git_config.json
. Put there your github access token, reponame, username and entrypoint command.
cd autodeploy && pip install -r requirements.txt
python3 install.py
Send POST-request to the end-point and the project will pull and be reloaded.
curl -X POST http://hostname:port/repo-is-updated
Your application should be running now.
You may use github webhooks to deploy application when repo updated.
Create webhook at Your-Repo -> Settings -> Webhooks -> add webhook