Merge pull request #4972 from mrveiss/issue-4945 #554
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Smoke Test | |
| on: | |
| push: | |
| branches: | |
| - Dev_new_gui | |
| schedule: | |
| - cron: '0 10 * * 0' # Every Sunday at 10 AM UTC | |
| jobs: | |
| smoke-test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create .env from .env.example | |
| run: cp .env.example .env | |
| - name: Start services with Docker Compose | |
| run: docker compose --env-file docker/.env.docker up -d | |
| - name: Wait for services to be healthy | |
| run: | | |
| echo "Waiting for services to start..." | |
| max_attempts=30 | |
| attempt=0 | |
| while [ $attempt -lt $max_attempts ]; do | |
| attempt=$((attempt + 1)) | |
| echo "Attempt $attempt/$max_attempts: Checking service health..." | |
| # Check if frontend is responding | |
| if curl -s -f http://localhost > /dev/null 2>&1; then | |
| echo "✓ Frontend responding on port 80" | |
| exit 0 | |
| fi | |
| sleep 10 | |
| done | |
| echo "Services failed to become healthy within 5 minutes" | |
| echo "" | |
| echo "=== Docker Compose Logs ===" | |
| docker compose --env-file docker/.env.docker logs | |
| exit 1 | |
| - name: Verify services are running | |
| run: | | |
| echo "Verifying services..." | |
| docker compose --env-file docker/.env.docker ps | |
| echo "" | |
| echo "=== Frontend Health Check ===" | |
| curl -v http://localhost 2>&1 | head -20 | |
| - name: Collect logs on failure | |
| if: failure() | |
| run: docker compose --env-file docker/.env.docker logs > failure-logs.txt | |
| - name: Upload failure logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-compose-logs | |
| path: failure-logs.txt | |
| - name: Clean up | |
| if: always() | |
| run: docker compose --env-file docker/.env.docker down |