4

What I want to do: Deploy docker-compose solution from Github to my virtual private server which has docker and docker-compose installed.

I saw that there are Github Actions that allow me to copy files over SSH after push to master, but I don't know how to run docker-compose up on my server after source has been copied.

On my VPS I have Ubuntu 18.4 installed.

Tomasz Sikora
  • 1,649
  • 3
  • 19
  • 30

1 Answers1

8

I believe Github actions also allow you to run arbitrary commands on remote servers via ssh (there are a few in their library).

Assuming you copy your docker-compose.yml into, /home/user/app/docker-compose.yml, you could run a command like so:

ssh user@yourserver.example.com "cd /home/user/app/ && docker-compose up -d"
timur
  • 14,239
  • 2
  • 11
  • 32