diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 810a96cb..6253c356 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,34 +1,33 @@ name: Build and Push Image -on: [ push ] +on: + push: + branches: + - main jobs: build: name: Build and push image - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Build Image - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - image: maistra-test-tool - tags: latest - containerfiles: | - ./Dockerfile + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - # Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in, - # in which case 'username' and 'password' can be omitted. - - name: Push To quay.io - id: push-to-quay - uses: redhat-actions/push-to-registry@v2 + - name: Login to Quay.io + uses: docker/login-action@v3 with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} - registry: quay.io/maistra + registry: quay.io username: maistra+kiali password: ${{ secrets.REGISTRY_PASSWORD }} - - - name: Print image url - run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" + + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x + push: true + tags: quay.io/maistra/maistra-test-tool:latest diff --git a/Dockerfile b/Dockerfile index 79ce3e53..cfc53ee2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest ARG HELM_VERSION="v3.11.3" ARG GO_VERSION="1.20.3" ARG OCP_VERSION="stable" +ARG TARGETARCH ENV GOPATH=/go ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH @@ -10,16 +11,16 @@ ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH ENV HOME=$GOPATH/src/maistra-test-tool RUN microdnf install -y --nodocs tar gzip openssl findutils make git && \ - curl -Lo ./oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OCP_VERSION}/openshift-client-linux.tar.gz && \ + curl -Lo ./oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OCP_VERSION}/openshift-client-linux-${TARGETARCH}-rhel9.tar.gz && \ tar -xf oc.tar.gz -C /usr/bin && \ rm -f oc.tar.gz && \ - curl -Lo ./golang.tar.gz https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && \ + curl -Lo ./golang.tar.gz https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz && \ tar -xf golang.tar.gz -C /usr/local && \ rm -f golang.tar.gz && \ - curl -LOk https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz && \ - tar -xzf helm-${HELM_VERSION}-linux-amd64.tar.gz && \ - mv linux-amd64/helm /usr/bin/ && \ - rm -rf helm-${HELM_VERSION}-linux-amd64.tar.gz linux-amd64 && \ + curl -LOk https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz && \ + tar -xzf helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz && \ + mv linux-${TARGETARCH}/helm /usr/bin/ && \ + rm -rf helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz linux-${TARGETARCH} && \ microdnf update -y && \ microdnf clean all -y && \ mkdir -p "$GOPATH/src/maistra-test-tool" "$GOPATH/bin"