Update .gitea/workflows/deploy.yml
All checks were successful
Deploy PHP App / deploy (push) Successful in 53s

This commit is contained in:
2026-04-02 10:22:52 +00:00
parent b2637c4637
commit 049a09088f

View File

@@ -28,10 +28,15 @@ jobs:
ssh -p "$SSH_PORT" "$SSH_USER@$SSH_HOST" "
set -e
echo 'APP_DIR: $APP_DIR'
echo 'REPO_URL: $REPO_URL'
if [ -d \"$APP_DIR/.git\" ]; then
echo 'Repo exists, pulling latest code'
echo 'Repo exists, updating remote and pulling latest code'
cd \"$APP_DIR\"
git remote set-url origin \"$REPO_URL\"
git fetch origin
git checkout \"$BRANCH\" || git checkout -b \"$BRANCH\"
git reset --hard origin/$BRANCH
else
echo 'Repo does not exist, cloning fresh'
@@ -40,6 +45,16 @@ jobs:
cd \"$APP_DIR\"
fi
docker compose down --remove-orphans || true
docker compose up -d --build
echo 'Current directory:'
pwd
echo 'Files in repo root:'
ls -la
if [ ! -f docker-compose.yml ]; then
echo 'ERROR: docker-compose.yml not found in $APP_DIR'
exit 1
fi
docker compose -f docker-compose.yml down --remove-orphans || true
docker compose -f docker-compose.yml up -d --build
"