From f732e7816186dd81b3800578d6cd7b57b042446e Mon Sep 17 00:00:00 2001 From: Omri Bar-Haim Date: Wed, 15 Jan 2025 11:27:41 +0200 Subject: [PATCH] Draft workflow to build & push new release image on-branch-push --- .github/workflows/release-branch-to-image.yml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/release-branch-to-image.yml diff --git a/.github/workflows/release-branch-to-image.yml b/.github/workflows/release-branch-to-image.yml new file mode 100644 index 000000000..c28f53c08 --- /dev/null +++ b/.github/workflows/release-branch-to-image.yml @@ -0,0 +1,55 @@ +name: Build and push release image of ods-ci + +on: + push: + branches: + - releases/* + +jobs: + build: + name: Build Release Image And Extract Image Tag + runs-on: ubuntu-latest + outputs: + image-tag: ${{ steps.extract_tag.outputs.tag }} + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Quay.io + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Extract Release Tag + id: extract_tag + run: | + echo "tag=release-${GITHUB_REF#refs/heads/releases/}" >> $GITHUB_OUTPUT + + - name: Build Release Image With Docker + run: | + docker buildx build \ + --platform linux/amd64 \ + --file ods_ci/build/Dockerfile_interop \ + --tag quay.io/modh/ods-ci:${{ steps.extract_tag.outputs.tag }} \ + --load + + push: + name: Push Release Image + needs: build + runs-on: ubuntu-latest + steps: + - name: Log in to Quay.io + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Push Release Image With Docker + run: | + docker push quay.io/modh/ods-ci:${{ needs.build.outputs.image-tag }}