From 6e3032330a7d300c2a6ac44ec163b03855470999 Mon Sep 17 00:00:00 2001 From: Mate Majoros Date: Wed, 16 Jul 2025 11:28:38 +0300 Subject: [PATCH] huge step split into smaller steps --- .github/workflows/deploy.yml | 44 ++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 904528a4..8ae7a83f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -139,27 +139,43 @@ jobs: echo '${{ secrets.GITHUB_TOKEN }}' | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin " - - name: Update and restart services + - name: Pull latest images run: | ssh ${{ env.HETZNER_USER }}@${{ env.HETZNER_HOST }} " cd ${{ env.DEPLOY_PATH }} - - # Pull latest images docker compose pull - - # Stop services gracefully + " + + - name: Stop services + run: | + ssh ${{ env.HETZNER_USER }}@${{ env.HETZNER_HOST }} " + cd ${{ env.DEPLOY_PATH }} docker compose down --timeout 30 - - # Start services + " + + - name: Start services + run: | + ssh ${{ env.HETZNER_USER }}@${{ env.HETZNER_HOST }} " + cd ${{ env.DEPLOY_PATH }} docker compose up -d - - # Wait for services to be ready - sleep 30 - - # Run migrations on all sites + " + + - name: Wait for services to be ready + run: | + echo "Waiting for services to start..." + sleep 30 + + - name: Run migrations + run: | + ssh ${{ env.HETZNER_USER }}@${{ env.HETZNER_HOST }} " + cd ${{ env.DEPLOY_PATH }} ./scripts/migrate-all-sites.sh - - # Show status + " + + - name: Check service status + run: | + ssh ${{ env.HETZNER_USER }}@${{ env.HETZNER_HOST }} " + cd ${{ env.DEPLOY_PATH }} docker compose ps "