From d5196355b8966e1d9534bc1b1210317b2b2c69a4 Mon Sep 17 00:00:00 2001 From: kannan112 Date: Sat, 2 Dec 2023 09:10:09 +0530 Subject: [PATCH] deployment stage --- .github/workflows/makefile.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index d7d4f54..0ddc326 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -42,14 +42,22 @@ jobs: runs-on: ubuntu-latest steps: + - name: Deploy to Server + uses: easingthemes/ssh-deploy@main + env: + SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }} + REMOTE_HOST: ${{ secrets.HOST_DNS }} + REMOTE_USER: ${{ secrets.USERNAME }} + TARGET: ${{ secrets.TARGET_DIR }} + - name: Connect to EC2 instance uses: appleboy/ssh-action@master with: - host: ${{secrets.EC2_PUBLIC_IP}} + host: ${{ secrets.HOST_DNS }} username: ubuntu - key: ${{secrets.EC2_SSH_KEY}} + key: ${{ secrets.EC2_SSH_KEY }} script: | - cd ecommerce-fashionsture-cleanarch/ + cd any-fashion-gin-clean-code git pull docker-compose down # Stop running containers docker-compose up -d --build # Recreate and start containers