I built something similar, a github action for doing gitops with docker compose (or swarm):
https://github.com/FarisZR/docker-compose-gitops-action
For other stuff I just use another version of the action to deploy files using Tailscale SSH: https://github.com/FarisZR/tailscale-ssh-deploy