flologsheet/.github/workflows/push-dappbundle.yml
SaketAnand 404a4e82a9
All checks were successful
Deploy to Dappbundle / Deploy (push) Successful in 43s
Update deployment workflow (main + master support + cleanup)
2026-03-06 17:49:15 +05:30

54 lines
1.4 KiB
YAML

name: Deploy to Dappbundle
on:
push:
branches:
- main
- master
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
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: |
set -e
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
cd "$BASE/dappbundle"
git pull
fi
echo "== Refreshing app bundle =="
rm -rf "$BASE/dappbundle/$APP"
git clone git@gitea.ranchimall.net:RanchiMall/$APP.git "$BASE/dappbundle/$APP"
echo "== Cleaning git metadata =="
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