Compare commits
No commits in common. "main" and "fetch_all_transactions" have entirely different histories.
main
...
fetch_all_
56
.github/workflows/push-dappbundle.yml
vendored
56
.github/workflows/push-dappbundle.yml
vendored
@ -1,18 +1,11 @@
|
|||||||
name: Deploy to Dappbundle
|
name: Workflow push to Dappbundle
|
||||||
|
on: [push]
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Deploy
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy via SSH
|
- name: Executing remote command
|
||||||
uses: appleboy/ssh-action@v1.0.0
|
uses: appleboy/ssh-action@v1.0.0
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.R_HOST }}
|
host: ${{ secrets.R_HOST }}
|
||||||
@ -20,35 +13,20 @@ jobs:
|
|||||||
password: ${{ secrets.P_PASSWORD }}
|
password: ${{ secrets.P_PASSWORD }}
|
||||||
port: ${{ secrets.SSH_PORT }}
|
port: ${{ secrets.SSH_PORT }}
|
||||||
script: |
|
script: |
|
||||||
set -e
|
if [ -d "${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle" ]; then
|
||||||
|
echo "Folder exists. Skipping Git clone."
|
||||||
BASE="${{ secrets.DEPLOYMENT_LOCATION }}"
|
|
||||||
APP="${{ github.event.repository.name }}"
|
|
||||||
|
|
||||||
echo "== Ensuring dappbundle repo exists =="
|
|
||||||
|
|
||||||
if [ ! -d "$BASE/dappbundle/.git" ]; then
|
|
||||||
git clone git@gitea.ranchimall.net:RanchiMall/dappbundle.git "$BASE/dappbundle"
|
|
||||||
else
|
else
|
||||||
cd "$BASE/dappbundle"
|
echo "Folder does not exist. Cloning repository..."
|
||||||
git pull
|
cd ${{ secrets.DEPLOYMENT_LOCATION}}/ && git clone https://github.com/ranchimall/dappbundle.git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "== Refreshing app bundle =="
|
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 }}"
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf "$BASE/dappbundle/$APP"
|
echo "Cloning repository..."
|
||||||
git clone git@gitea.ranchimall.net:RanchiMall/$APP.git "$BASE/dappbundle/$APP"
|
cd ${{ secrets.DEPLOYMENT_LOCATION}}/dappbundle && git clone https://github.com/ranchimall/${{ github.event.repository.name }}
|
||||||
|
|
||||||
echo "== Cleaning git metadata =="
|
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 "$BASE/dappbundle/$APP"
|
|
||||||
rm -rf .git .github .gitignore .gitattributes
|
|
||||||
|
|
||||||
cd "$BASE/dappbundle"
|
|
||||||
|
|
||||||
git config user.email "ranchimallfze@gmail.com"
|
|
||||||
git config user.name "ranchimall"
|
|
||||||
|
|
||||||
git add .
|
|
||||||
git commit -m "Auto-update $APP" || echo "No changes"
|
|
||||||
git push
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user