From eecc7c7f7633e15d5c054d24b1f4969ff71311eb Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Mon, 18 Dec 2023 20:23:02 +0530 Subject: [PATCH] Update repopush.yml --- .github/workflows/repopush.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/repopush.yml b/.github/workflows/repopush.yml index 62a1f4e..62646a2 100644 --- a/.github/workflows/repopush.yml +++ b/.github/workflows/repopush.yml @@ -1,4 +1,4 @@ -name: Pull changes and deploy API +name: Workflow push to Dappbundle on: [push] jobs: build: @@ -13,20 +13,20 @@ jobs: password: ${{ secrets.P_PASSWORD }} port: ${{ secrets.SSH_PORT }} script: | - if [ -d "/home/production/deployed/dappbundle" ]; then + if [ -d "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle" ]; then echo "Folder exists. Skipping Git clone." else echo "Folder does not exist. Cloning repository..." - cd /home/production/deployed/ && git clone https://github.com/ranchimall/dappbundle.git + cd ${{ secrets.DEPLOYMENT_LOCATION}}/ && git clone https://github.com/ranchimall/dappbundle.git fi - if [ -d "/home/production/deployed/dappbundle/${{ github.event.repository.name }}" ]; then + if [ -d "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/${{ github.event.repository.name }}" ]; then echo "Repository exists. Remove folder " - rm -r "/home/production/deployed/dappbundle/${{ github.event.repository.name }}" + rm -r "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/${{ github.event.repository.name }}" fi echo "Cloning repository..." - cd /home/production/deployed/dappbundle && git clone https://github.com/ranchimall/${{ github.event.repository.name }} + cd ${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle && git clone https://github.com/ranchimall/${{ github.event.repository.name }} - cd "/home/production/deployed/dappbundle/${{ github.event.repository.name }}" && rm -r .gitattributes - cd /home/production/deployed/dappbundle/ && git add . && git commit -m "Workflow updating files of ${{ github.event.repository.name }}" && git push "https://ranchimalldev:${{ secrets.RM_ACCESS_TOKEN }}@github.com/ranchimall/dappbundle.git" + cd "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/${{ github.event.repository.name }}" && rm -rf .gitattributes .git .github .gitignore + cd ${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/ && git add . && git commit -m "Workflow updating files of ${{ github.event.repository.name }}" && git push "https://ranchimalldev:${{ secrets.RM_ACCESS_TOKEN }}@github.com/ranchimall/dappbundle.git"