From 1db2931f46d7f22e152fb2b627cfeff40ca02434 Mon Sep 17 00:00:00 2001 From: kosipov Date: Fri, 3 Apr 2026 01:24:19 +0300 Subject: [PATCH] fix deploy --- .gitea/workflows/deploy.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 7470662..f7fd76e 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -50,19 +50,35 @@ jobs: git checkout main git reset --hard origin/main + PHP_BIN="/opt/php84/bin/php" + if [ ! -x "$PHP_BIN" ]; then + PHP_BIN="$(command -v php || true)" + fi + + if [ -z "$PHP_BIN" ] || [ ! -x "$PHP_BIN" ]; then + echo "PHP binary not found" + exit 1 + fi + + COMPOSER_BIN="$(command -v composer || true)" + if [ -z "$COMPOSER_BIN" ]; then + echo "Composer binary not found" + exit 1 + fi + if [ -f composer.json ]; then - composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev + "$PHP_BIN" "$COMPOSER_BIN" install --no-interaction --prefer-dist --optimize-autoloader --no-dev fi if [ -f artisan ]; then - php artisan down --retry=60 || true - trap 'php artisan up || true' EXIT + "$PHP_BIN" artisan down --retry=60 || true + trap '"$PHP_BIN" artisan up || true' EXIT - php artisan optimize:clear - php artisan migrate --force - php artisan storage:link || true - php artisan config:cache - php artisan view:cache - php artisan queue:restart || true + "$PHP_BIN" artisan optimize:clear + "$PHP_BIN" artisan migrate --force + "$PHP_BIN" artisan storage:link || true + "$PHP_BIN" artisan config:cache + "$PHP_BIN" artisan view:cache + "$PHP_BIN" artisan queue:restart || true fi EOF