Files
sgeUpdated/.gitea/workflows/sgeupdated.yml
Abdulbari b1cf711420
All checks were successful
sgeUpdated Smoke Test / smoke-test (push) Successful in 6s
sgeUpdated CI/CD / deploy (push) Successful in 21s
Update sgeupdated pipeline v14
multiple changes applied to make the workflows works over ssh
2025-08-30 20:58:45 +03:00

43 lines
1.2 KiB
YAML

# .gitea/workflows/sgeupdated.yml
name: sgeUpdated CI/CD
on:
push:
branches:
- main # trigger only when code is merged into main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Deploy over SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script_stop: true
script: |
cd /home/ubuntu/sgeUpdated
git pull origin main
echo "Detecting changes..."
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
# --- Backend ---
if echo "$CHANGED_FILES" | grep -q "sge-backend"; then
echo "⚙️ Backend changes detected..."
docker compose build --no-cache backend
docker compose up -d --force-recreate backend
fi
# --- Frontend ---
if echo "$CHANGED_FILES" | grep -q "sge-frontend"; then
echo "⚙️ Frontend changes detected..."
docker compose build --no-cache frontend
docker compose up -d --force-recreate frontend
fi