From f6a0a517bc8666a10b64b1227c50f439913d72f7 Mon Sep 17 00:00:00 2001 From: Marcin Bator Date: Thu, 5 Dec 2024 16:07:25 +0100 Subject: [PATCH] Create deploy.yml --- .github/workflows/deploy.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b5bb3d5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: Deploy + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Deploy + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.REMOTE_HOST }} + username: ${{ secrets.REMOTE_USER }} + port: ${{ secrets.REMOTE_PORT }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + cd /home/project/rag-2-ai + git checkout main + git pull + cd /home/project + docker compose up --build -d + echo "$(date): ai deployed successfully" >> deploy-log.txt + docker system prune -f