From a22d2dd61dc6fe3e71a91945859fd35f6fc57d1a Mon Sep 17 00:00:00 2001 From: deowl Date: Sun, 24 May 2026 20:00:07 +0000 Subject: [PATCH] Update .gitea/workflows/deploy-remote.yml --- .gitea/workflows/deploy-remote.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/deploy-remote.yml b/.gitea/workflows/deploy-remote.yml index 17808dd..709f976 100644 --- a/.gitea/workflows/deploy-remote.yml +++ b/.gitea/workflows/deploy-remote.yml @@ -1,14 +1,11 @@ name: Deploy to Remote Server on: - # Trigger after successful build (using workflow_run) workflow_run: workflows: ["Build and Deploy Docker Image"] types: - completed branches: ["main"] - - # Allow manual trigger for redeployment workflow_dispatch: inputs: image_tag: @@ -21,12 +18,11 @@ env: IMAGE_NAME: vkrb/quantum_backend REMOTE_HOST: ${{ secrets.REMOTE_HOST }} REMOTE_USER: ${{ secrets.REMOTE_USER }} - REMOTE_PORT: ${{ secrets.REMOTE_PORT }} # Add this + REMOTE_PORT: ${{ secrets.REMOTE_PORT }} COMPOSE_PATH: /usr/local/share/vkrb/quantum_backend jobs: deploy: - # Only run if the build workflow succeeded if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest @@ -35,7 +31,7 @@ jobs: uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.REMOTE_HOST }} - port: ${{ secrets.REMOTE_PORT }} # Add this line + port: ${{ secrets.REMOTE_PORT }} username: ${{ secrets.REMOTE_USER }} key: ${{ secrets.SSH_PRIVATE_KEY }} script_stop: true @@ -56,15 +52,17 @@ jobs: echo "Deploying tag: $TAG" - # Method 1: Using environment variable (recommended) - export IMAGE_TAG=$TAG - docker compose pull app # Pull only the app service + # Update .env file with the tag (if you're using env_file) + echo "IMAGE_TAG=$TAG" > .env - # Redeploy with the new image - docker compose up -d --no-deps --force-recreate app + # Pull only the quantum-backend service (not 'app'!) + docker compose pull quantum-backend + + # Redeploy with the new image - use correct service name + docker compose up -d --no-deps --force-recreate quantum-backend # Clean up old images docker image prune -f # Check container status - docker compose ps + docker compose ps \ No newline at end of file