name: Production Blog Deployment on: push: branches: - main env: CONTAINER_NAME: blog_production URL: "https://blog.vezpi.com/en/" jobs: deploy: runs-on: docker container: volumes: - /appli/docker/blog:/blog defaults: run: shell: sh steps: - name: Restart ${CONTAINER_NAME} container run: | cd /blog docker compose down ${CONTAINER_NAME} docker compose up -d ${CONTAINER_NAME} sleep 5 echo "- Displaying container logs" docker compose logs ${CONTAINER_NAME} test: needs: deploy runs-on: ubuntu steps: - name: Check HTTP response run: | code=$(curl -s -o /dev/null -w "%{http_code}" "$URL") echo "HTTP response code: $code" if [ "$code" -ne 200 ]; then echo "❌ Service is not healthy (HTTP $code)" exit 1 else echo "✅ Service is healthy" fi