0

I have a server that I deploy many of my personal projects to. These projects are stored & built on Github and deployed automatically via Github actions. I originally did this via the SSH Deploy action, which would rsync the updated application to the server and then restart its systemd unit. However I have decided to try and containerize all my projects for easier management. I created a private container registry and this workflow which builds the app and publishes it to the private registry. This is all well and good but then I have to manually log into the server and recreate the container to get the latest version actually deployed. I am trying to automate this via a Github action.

I am aware of Watchtower, but my understanding of it is it just checks in with the registry periodically to make sure it is on the latest version. This is not ideal for me because I want the container to be updated immediately. If watchtower has some sort of webhook I can hit to hint at it from Github that the image has been updated, that would be cool. If not or if there is a better approach, let me know your ideas.

Thanks in advance

2 Answers 2

0

I came up with 2 solutions

1: Use the appleboy/ssh-action to ssh into the server and run a script

2: Use the websocket feature of portainer

0

https://containrrr.dev/watchtower/http-api-mode/

Watchtower has a webhook feature built in, which will require the port to be forwarded but in my experience this seems to work well and updates it immediately. Since youre using github actions all you'd need to do is send the HTTP request to the watchtower container (how you do this is your choice). There is also a watchtower update action but I havent yet had success with this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .