Test-gated image build
A test-gated image build makes successful CI verification a prerequisite for building and publishing container images. In this course, the build job depends on the test job through GitHub Actions needs, preventing a failed test run from publishing new API or worker images.
Minimal example
build:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'