diff --git a/.changeset/ci-build-on-pull-request.md b/.changeset/ci-build-on-pull-request.md new file mode 100644 index 000000000..234bcaf1c --- /dev/null +++ b/.changeset/ci-build-on-pull-request.md @@ -0,0 +1,7 @@ +--- +"worker-comfyui": patch +--- + +ci: build base image on every pull request so PR changes are testable before merge + +Previously the `Development` workflow only ran on manual `workflow_dispatch`, and `release.yml` only built images after a `chore: version packages` commit landed on `main`. That meant fixes couldn't be deployed and tested on a real Runpod endpoint until they were already merged. With this change, opening or pushing to a PR builds and pushes a `base` image tagged with the branch slug (e.g. `:fix-pin-boto3`), so reviewers can deploy that exact image to a serverless endpoint and verify behavior before approval. diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 741c28c35..56ed9ad20 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -2,9 +2,12 @@ name: Development on: workflow_dispatch: -# push: -# branches-ignore: -# - main + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - "**.md" + - "docs/**" + - ".changeset/**" jobs: dev: @@ -42,7 +45,11 @@ jobs: echo "DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO }}" >> $GITHUB_ENV echo "DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG }}" >> $GITHUB_ENV echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV - echo "RELEASE_VERSION=${GITHUB_REF##refs/heads/}" | sed 's/\//-/g' >> $GITHUB_ENV + # On pull_request: GITHUB_HEAD_REF is the source branch (e.g. fix/foo). + # On workflow_dispatch / push: fall back to the ref's branch name. + BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF##refs/heads/}}" + BRANCH_SLUG=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "RELEASE_VERSION=${BRANCH_SLUG}" >> $GITHUB_ENV - name: Build and push the base image to Docker Hub uses: docker/bake-action@v2