From 52405d93dd6806461a1a2d1f5fc7899d4a04e37f Mon Sep 17 00:00:00 2001 From: tripathyr Date: Fri, 25 Jul 2025 06:56:53 +0530 Subject: [PATCH] Changing build to Github servers --- .github/workflows/push-dappbundle.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push-dappbundle.yml b/.github/workflows/push-dappbundle.yml index 62646a2..8466a3e 100644 --- a/.github/workflows/push-dappbundle.yml +++ b/.github/workflows/push-dappbundle.yml @@ -1,9 +1,12 @@ name: Workflow push to Dappbundle + on: [push] + jobs: build: name: Build - runs-on: self-hosted + runs-on: ubuntu-latest # ✅ Changed from self-hosted to GitHub-hosted + steps: - name: Executing remote command uses: appleboy/ssh-action@v1.0.0 @@ -13,20 +16,24 @@ jobs: password: ${{ secrets.P_PASSWORD }} port: ${{ secrets.SSH_PORT }} script: | - if [ -d "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle" ]; then + if [ -d "${{ secrets.DEPLOYMENT_LOCATION }}/dappbundle" ]; then echo "Folder exists. Skipping Git clone." else echo "Folder does not exist. Cloning repository..." - cd ${{ secrets.DEPLOYMENT_LOCATION}}/ && git clone https://github.com/ranchimall/dappbundle.git + cd "${{ secrets.DEPLOYMENT_LOCATION }}" && git clone https://github.com/ranchimall/dappbundle.git fi - if [ -d "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/${{ github.event.repository.name }}" ]; then - echo "Repository exists. Remove folder " - rm -r "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle/${{ github.event.repository.name }}" + if [ -d "${{ secrets.DEPLOYMENT_LOCATION }}/dappbundle/${{ github.event.repository.name }}" ]; then + echo "Repository exists. Removing folder." + rm -rf "${{ secrets.DEPLOYMENT_LOCATION }}/dappbundle/${{ github.event.repository.name }}" fi echo "Cloning repository..." - cd ${{ secrets.DEPLOYMENT_LOCATION}}/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 "${{ 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" + 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"