First make make a script that deploys it. Then convert that script into a workflow. In the end your workflow will be 3 steps:
- Checkout the repo
- Create SSH key
- Copy to host and restart service
For the SSH key I would encode it via base64 before storing it as a forgejo secret. You can do via something like this:
cat private.key | base64 -w 0
And then in your workflow
echo $APP_SSH_KEY | base64 -d > ~/.ssh/id_ed25519 (assuming you use ed25519 which is the default key)
I would also advise moving away from docker in favor of podman since docker uses root by default
Another approach could be pushing to the forgejo container registry and then setting your docker host to auto update