From c19e9fcab64d62edd62c7e4355f83252ecbe7221 Mon Sep 17 00:00:00 2001 From: felkng Date: Mon, 18 May 2026 22:23:10 -0300 Subject: [PATCH] chore(ci): remove VPS deployment workflow - Delete deploy.yml which automated SSH-based deployment to the VPS. - This change removes the automated deployment step triggered on push to main. --- .github/workflows/deploy.yml | 77 ------------------------------------ 1 file changed, 77 deletions(-) delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index eab6e62..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Deploy - -on: - push: - branches: [main] - -jobs: - tests: - name: Tests - uses: ./.github/workflows/phpunit.yml - - deploy: - name: Deploy to VPS - runs-on: ubuntu-latest - needs: [tests] - if: always() && (needs.tests.result == 'success' || needs.tests.result == 'skipped') - - steps: - - name: Deploy via SSH - uses: appleboy/ssh-action@v1 - with: - host: ${{ secrets.VPS_HOST }} - username: ${{ secrets.VPS_USER }} - key: ${{ secrets.VPS_SSH_KEY }} - script: | - set -e - cd "${{ secrets.VPS_PROJECT_PATH }}" - - # Record current HEAD before pulling - BEFORE=$(git rev-parse HEAD) - - git stash --include-untracked || true - git pull origin main - git stash pop || true - - # Ensure judge0.conf exists (it is gitignored, only judge0.conf.example is tracked) - if [ ! -f judge0.conf ]; then - echo "WARNING: judge0.conf not found, copying from example. Update passwords before use!" - cp judge0.conf.example judge0.conf - fi - - AFTER=$(git rev-parse HEAD) - - # Detect what actually changed on the VPS (covers failed deploys too) - CHANGED=$(git diff --name-only "$BEFORE" "$AFTER") - - SERVICES="" - - if echo "$CHANGED" | grep -q '^back/'; then - SERVICES="$SERVICES backend_app queue_worker" - fi - - if echo "$CHANGED" | grep -q '^front/'; then - SERVICES="$SERVICES frontend_app" - fi - - if echo "$CHANGED" | grep -q '^ws-server/'; then - SERVICES="$SERVICES ws_server" - fi - - if echo "$CHANGED" | grep -q '^docker-compose.prod.yml'; then - SERVICES="backend_app queue_worker frontend_app ws_server" - fi - - if [ -n "$SERVICES" ]; then - echo "Rebuilding: $SERVICES" - docker compose -f docker-compose.prod.yml up -d --build $SERVICES - else - echo "No service changes detected" - fi - - if echo "$CHANGED" | grep -q '^back/'; then - docker exec laravel_app php artisan migrate --force - docker exec laravel_app php artisan config:cache - docker exec laravel_app php artisan route:cache - docker exec laravel_app php artisan view:cache - fi