From 4f9ca9f9a994753eddfd8af573f12d34895a1015 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 26 Oct 2023 22:22:36 +0200 Subject: [PATCH] ci: Adds CI job to autodeploy docker --- .github/workflows/push.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5f184ce..bf98a32 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -26,3 +26,17 @@ jobs: password: ${{ secrets.DOCKERHUB_PW }} - name: Push to hub run: docker push quackai/contribution-api:latest + + deploy-dev: + needs: dockerhub + runs-on: ubuntu-latest + steps: + - uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.SSH_DEV_HOST }} + username: ${{ secrets.SSH_DEV_USERNAME }} + key: ${{ secrets.SSH_DEPLOY_DEV }} + script: | + docker pull quackai/contribution-api:latest + cd devops && docker compose stop backend && docker compose up -d + docker inspect -f '{{ .Created }}' $(docker compose images -q backend)