From 8be5d914d5d679a0797617b47994a3793d2e00e4 Mon Sep 17 00:00:00 2001 From: s0nicboOm Date: Mon, 28 Aug 2023 14:34:31 -0700 Subject: [PATCH] fix: update workflow Signed-off-by: s0nicboOm --- .github/workflows/release.yml | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..e023b1bc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Docker Image Push + +on: + push: + tags: + - v* + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v3 + + - name: Set output + id: vars + run: | + echo "${{ secrets.QUAYIO_USERNAME }}" + + - name: Docker Login + uses: docker/login-action@v2.1.0 + with: + registry: quay.io + username: ${{ secrets.QUAYIO_USERNAME }} + password: ${{ secrets.QUAYIO_PASSWORD }} + + - name: Docker Build + env: + QUAYIO_ORG: quay.io/numaio + PLATFORM: linux/x86_64 + TARGET: numalogic/udf + run: | + type=$(basename $(dirname $GITHUB_REF)) + tag=$(basename $GITHUB_REF) + + if [[ $type == "heads" ]]; then + tag="$(basename $GITHUB_REF)v${{ env.version }}" + fi + + image_name="${QUAYIO_ORG}/numalogic/udf:${tag}" + + docker buildx build \ + --output "type=image,push=true" \ + --platform="${PLATFORM}" \ + --tag $image_name . \ No newline at end of file