Update cloudphone.js #11
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: Deploy with Docker Compose | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: authenticator-backend | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Deploy containers | |
| env: | |
| ALLOWED_ORIGINS: ${{ secrets.ALLOWED_ORIGINS }} | |
| run: | | |
| echo "🔍 Checking redis container status..." | |
| if docker ps --filter "name=redis" --filter "health=healthy" --format '{{.Names}}' | grep -q '^redis$'; then | |
| echo "✅ Redis container is already healthy. Skipping redis restart." | |
| REDIS_RUNNING=true | |
| else | |
| echo "⚠️ Redis not running or unhealthy. It will be (re)started." | |
| REDIS_RUNNING=false | |
| fi | |
| echo "🚀 Starting deployment..." | |
| if [ "$REDIS_RUNNING" = true ]; then | |
| docker compose -f docker-compose-prod.yml up -d --build --no-deps app | |
| else | |
| docker compose -f docker-compose-prod.yml up -d --build | |
| fi | |
| echo "🧹 Cleaning up unused resources..." | |
| docker system prune -f | |
| - name: Verify containers | |
| run: | | |
| docker ps | |
| echo | |
| echo "📋 Container health statuses:" | |
| docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" |