diff --git a/.github/workflows/buid-push.yaml b/.github/workflows/buid-push.yaml new file mode 100644 index 00000000..065fba3b --- /dev/null +++ b/.github/workflows/buid-push.yaml @@ -0,0 +1,45 @@ +on: + pull_request: + types: + - closed + paths: + - "pkg/*/examples/go.sum" + - "pkg/*/examples/go.mod" + +jobs: + if_merged: + if: github.event.pull_request.merged == true + name: Build and Push Images + runs-on: ubuntu-latest + + strategy: + matrix: + repository: [ + "map-even-odd", "map-flatmap", "map-forward-message", "map-retry", "map-tickgen", + "map-flatmap-stream", "reduce-counter", "reduce-sum", "reduce-stream-counter", + "reduce-stream-sum", "session-counter", "sideinput-example", "udf-sideinput-example", + "sink-log", "source-simple-source", "mapt-assign-event-time", "mapt-event-time-filter" + ] + + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Quay.io registry + env: + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ env.QUAY_USERNAME }} + password: ${{ env.QUAY_PASSWORD }} + - name: Build and tag images + run: ./update_examples --build + - name: Push images + env: + IMAGE_PREFIX: "quay.io/numaio/numaflow-go" + TAG: "stable" + run: | + docker push ${{ env.IMAGE_PREFIX }}/${{ matrix.repository }}:${{ env.TAG }} diff --git a/update_examples.sh b/update_examples.sh index a9d86cf0..143a57a4 100755 --- a/update_examples.sh +++ b/update_examples.sh @@ -4,7 +4,7 @@ function show_help () { echo "Usage: $0 [-h|--help] (-b|--build | -c|--commit-sha )" echo " -h, --help Display help message and exit" echo " -b, --build Build the docker images of all the examples" - echo " -c, --commit-sha Update the numaflow-go version to the specified SHA" + echo " -c, --commit-sha Update all the examples to depend on the numaflow-go version with the specified SHA" } function traverse_examples () {