Deploy: auto-clone on first run, set -e for fail-fast
Deploy to Production (witstore.wende.it) / deploy (push) Failing after 2s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 18:35:57 +02:00
co-authored by Claude Sonnet 4.6
parent d5236143aa
commit 9923d0227b
+17 -2
View File
@@ -18,16 +18,31 @@ jobs:
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /var/www/vhosts/witstore.wende.it/httpdocs
git remote set-url origin https://marco:${{ secrets.GIT_TOKEN }}@git.wende.it/marco/WitShop.git
set -e
DEPLOY_PATH="/var/www/vhosts/witstore.wende.it/httpdocs"
GIT_URL="https://marco:${{ secrets.GIT_TOKEN }}@git.wende.it/marco/WitShop.git"
if [ ! -d "$DEPLOY_PATH/.git" ]; then
echo "==> Erstmalig klonen"
git clone -b DEV "$GIT_URL" "$DEPLOY_PATH"
else
echo "==> Code aktualisieren"
cd "$DEPLOY_PATH"
git remote set-url origin "$GIT_URL"
git fetch origin DEV
git reset --hard origin/DEV
fi
cd "$DEPLOY_PATH"
/opt/plesk/php/8.4/bin/php -d open_basedir="" /usr/local/psa/var/modules/composer/composer.phar install --no-dev --optimize-autoloader
/opt/plesk/php/8.4/bin/php -d open_basedir="" artisan migrate --force
/opt/plesk/php/8.4/bin/php -d open_basedir="" artisan config:cache
/opt/plesk/php/8.4/bin/php -d open_basedir="" artisan route:cache
/opt/plesk/php/8.4/bin/php -d open_basedir="" artisan view:cache
export PATH="$HOME/.nodenv/versions/24/bin:$HOME/.nodenv/shims:$HOME/.nodenv/bin:$PATH"
npm ci
npm run build
echo "Deployment abgeschlossen: $(date)"