btcwallet/.github/workflows/repopush.yml
Vivek Teega d00cd300b3 test
2023-12-18 19:17:29 +05:30

34 lines
1.3 KiB
YAML

name: Pull changes and deploy API
on: [push]
jobs:
build:
name: Build
runs-on: self-hosted
steps:
- name: Executing remote command
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.R_HOST }}
username: ${{ secrets.P_USERNAME }}
password: ${{ secrets.P_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
if [ -d "/home/production/deployed/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
fi
if [ -d "/home/production/deployed/dappbundle/${{ github.event.repository.name }}" ]; then
echo "Repository exists. Skipping Git clone."
else
echo "Repo does not exist. Cloning repository..."
cd /home/production/deployed/dappbundle && git clone "https://github.com/ranchimall/${{ github.event.repository.name }}.git"
fi
cd "/home/production/deployed/dappbundle/${{ github.event.repository.name }}" && rm -r .gitattributes
cd /home/production/deployed/dappbundle/ && git push "https://ranchimalldev:${{ secrets.RM_ACCESS_TOKEN }}@github.com/ranchimall/dappbundle.git"