From 3cee2adc0838dd70e2bef8acc3e93f5558fa181e Mon Sep 17 00:00:00 2001 From: ZeinebMESSAOUDI <130365664+Zeineb2001@users.noreply.github.com> Date: Sun, 22 Dec 2024 21:34:05 +0100 Subject: [PATCH] Update inventory-ci-cd.yml --- .github/workflows/inventory-ci-cd.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/inventory-ci-cd.yml b/.github/workflows/inventory-ci-cd.yml index 246c7fbe..1821d6ad 100644 --- a/.github/workflows/inventory-ci-cd.yml +++ b/.github/workflows/inventory-ci-cd.yml @@ -56,12 +56,17 @@ jobs: run: | mkdir -p ~/.ssh ssh-keyscan -H ${{ secrets.DEPLOYMENT_MACHINE_IP }} >> ~/.ssh/known_hosts - + - name: Create destination directory on VPS + run: | + sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" ssh ${{ secrets.DEPLOYMENT_MACHINE_USER }}@${{ secrets.DEPLOYMENT_MACHINE_IP }} \ + "mkdir -p ~/inventory-service" + - name: Transfer JAR to VPS run: | - sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" scp ./inventory-service-1.0.0-SNAPSHOT.jar \ + sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" scp inventory-service-1.0.0-SNAPSHOT.jar \ ${{ secrets.DEPLOYMENT_MACHINE_USER }}@${{ secrets.DEPLOYMENT_MACHINE_IP }}:~/inventory-service/service-inventory.jar + - name: Verify if the JAR file exists on the VPS run: | sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" ssh ${{ secrets.DEPLOYMENT_MACHINE_USER }}@${{ secrets.DEPLOYMENT_MACHINE_IP }} \