ci: build base image on every pull request#223
Conversation
Enable the Development workflow to trigger on pull_request events so PR changes can be deployed and tested on a real Runpod endpoint before merging. Falls back to GITHUB_HEAD_REF for the branch name on PR events (GITHUB_REF is refs/pull/N/merge there) and slugs the branch name into a Docker-safe tag.
|
Validation status: this PR's own workflow works ✅ Used `gh workflow run dev.yml --ref ci/build-on-pull-request` (workflow_dispatch on this branch) which exercises the new trigger / tag logic from this PR. Build succeeded in ~5 min and the image was pushed as expected. Then dispatched the same way on #224 and #225 — both succeeded, tagging cleanly as `runpod/worker-comfyui:fix-pin-boto3-for-non-aws-s3-base` and `runpod/worker-comfyui:fix-enable-png-workflow-metadata-base` respectively. What I didn't directly validate: that the `pull_request` trigger fires automatically when a PR is opened. That can only be tested by actually opening the next PR after this lands and watching for the workflow. Low risk — the GitHub Actions `pull_request` trigger is well-trodden ground. Recommend merging. Once merged, all subsequent PR images get built automatically and we can validate #224/#225/#191/#221/#222 etc. on real endpoints without manual dispatches. |
Summary
Today the `Development` workflow only runs on manual `workflow_dispatch`, and the `release` workflow only builds images after a `chore: version packages` commit lands on `main`. So PR changes can't be deployed to a real serverless endpoint until they're already merged. That makes it impossible to validate behavior before approval — we're flying blind.
This PR makes `Development` build the `base` image on every PR push (opened / synchronize / reopened / ready_for_review), tagged with the branch slug. So opening this very PR should produce `runpod/worker-comfyui:ci-build-on-pull-request-base` (or whatever the configured DOCKERHUB_REPO/IMG resolves to). Then deploying a serverless endpoint with that image lets us test the PR.
Changes
Why `paths-ignore`
Builds are heavy (~20-30 min on Blacksmith). Skip the build for PRs that only touch markdown, `docs/`, or `.changeset/` files. Behavior-affecting PRs (anything in `src/`, `handler.py`, `Dockerfile`, workflows, `.runpod/`) still trigger a build.
Risks
Test plan