A git hook-based Phoenix deploy
This is what I did. Suggestions or improvements are welcome. Here I’m assuming the app is called my_app
and it will run as app_user
.
Create a bare git repository
Create a post-receive hook /home/app_user/repo/hooks/post-receive
with something like this
Now make the bare repository a remote
You can now deploy with
The service is handled by systemd. This is how the service is defined (/etc/systemd/system/my_app.service
):