name: ComfyUI Build & Deploy on: push: branches: [ create_image ] pull_request: branches: [ create_image ] workflow_dispatch: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: # Quick validation and build build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Quick validation run: | # Python syntax check python3 -m py_compile runpod_handler.py echo "✅ Python syntax OK" # Dockerfile check if [ ! -f Dockerfile ]; then echo "❌ Dockerfile missing" exit 1 fi echo "✅ Dockerfile exists" # Environment template check if [ ! -f .env.example ]; then echo "❌ .env.example missing" exit 1 fi echo "✅ Environment template OK" - name: Trigger RunPod Build if: github.ref == 'refs/heads/create_image' && github.event_name == 'push' run: | echo "🚀 Triggering RunPod build..." # Simple RunPod API call curl -X POST \ -H "Authorization: Bearer ${{ secrets.RUNPOD_API_KEY }}" \ -H "Content-Type: application/json" \ https://api.runpod.ai/v2/${{ secrets.RUNPOD_ENDPOINT_ID }}/rebuild || echo "⚠️ Manual rebuild required" echo "✅ RunPod build triggered" - name: Summary run: | echo "🎉 Pipeline completed!" if [ "${{ github.ref }}" = "refs/heads/create_image" ] && [ "${{ github.event_name }}" = "push" ]; then echo "✅ RunPod build triggered" else echo "ℹ️ RunPod build skipped (not main branch push)" fi