From 6337080ac02eaa73d1cc995e9e08dd4edee6bfae Mon Sep 17 00:00:00 2001 From: theoleuthardt Date: Sun, 23 Feb 2025 00:20:20 +0100 Subject: [PATCH] fix: SSH connections for docker deployment on server --- .github/workflows/deploy.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1415e47..683dd99 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -45,4 +45,18 @@ jobs: with: context: ./backend push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/werkzeugkiste-backend:latest \ No newline at end of file + tags: ${{ secrets.DOCKERHUB_USERNAME }}/werkzeugkiste-backend:latest + + deploy-on-server: + runs-on: ubuntu-latest + + steps: + - name: Deploy on Server + uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + cd /home/theo/docker/werkzeugkiste + docker compose up -d --pull always \ No newline at end of file