Repository: redhat-developer/mapt
Pull request #413: ci : Move arm64 platform image build to a separate github workflow
Author: login: rohanKanojia
Created: 2025-03-06T13:05:56Z | Merged: 2025-03-07T15:48:27Z

# Description

~⚠️ This is still work in progress. I haven't verified that behavior is still same as single target yet.~

Related to #364

Split oci-build Makefile target into different targets for handling amd64 and arm64 platforms separately.

Use a separate github action workflow to invoke separated Makefile targets to create container images


Diff:
diff --git a/.github/workflows/build-oci.yaml b/.github/workflows/build-oci.yaml
index dea51258f..3f9b8eb65 100644
--- a/.github/workflows/build-oci.yaml
+++ b/.github/workflows/build-oci.yaml
@@ -1,3 +1,19 @@
+#
+# Copyright (C) 2025 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
 name: oci-builds
 
 on:
@@ -9,56 +25,65 @@ on:
     branches: [ main ]
 
 jobs:
-  build:
-    name: build
-    runs-on: ubuntu-24.04
+  build-and-upload:
+    name: Build and Upload Images
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-24.04, ubuntu-24.04-arm]
     steps:
-      - name: Prepare runner for build multi arch
-        shell: bash
-        run: |
-          sudo apt-get update && sudo apt-get install -y qemu-user-static
-
       - name: Checkout code
-        uses: actions/checkout@v4
-
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+      - name: Install Podman (only for arm64)
+        if: contains(matrix.os, 'arm')
+        run: |
+          sudo apt-get update -y
+          sudo apt-get -y install podman
+      - name: Set environment variables based on architecture
+        run: |
+          if [[ "${{ matrix.os }}" == *"arm"* ]]; then
+            echo "ARCH_TYPE=arm64" >> $GITHUB_ENV
+          else
+            echo "ARCH_TYPE=amd64" >> $GITHUB_ENV
+          fi
       - name: Build image for PR
-        if: github.event_name == 'pull_request' 
+        if: github.event_name == 'pull_request'
         env:
           IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
         shell: bash
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
           echo ${IMG} > mapt-image
 
       - name: Build and Push image for Release
         if: github.event_name == 'push'
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
 
       - name: Upload mapt artifacts for PR
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
         with:
-          name: mapt
+          name: mapt-${{ env.ARCH_TYPE }}
           path: mapt*
 
   push:
     name: push
-    if: github.event_name == 'push' 
-    needs: build
+    if: github.event_name == 'push'
+    needs: build-and-upload
     runs-on: ubuntu-24.04
     steps:
       - name: Checkout code
-        uses: actions/checkout@v4
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
 
       - name: Download mapt oci flatten images
-        uses: actions/download-artifact@v4
+        uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
         with:
-          name: mapt
+          pattern: mapt-*         
         
       - name: Log in quay.io
-        uses: redhat-actions/podman-login@v1
+        uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
         with:
           registry: quay.io
           username: ${{ secrets.QUAY_IO_USERNAME }}
@@ -69,6 +94,3 @@ jobs:
         run: |
           make oci-load
           make oci-push
-
-      
-
diff --git a/.github/workflows/push-oci-pr.yml b/.github/workflows/push-oci-pr.yml
index 5c29ccebd..e118e7d25 100644
--- a/.github/workflows/push-oci-pr.yml
+++ b/.github/workflows/push-oci-pr.yml
@@ -1,3 +1,19 @@
+#
+# Copyright (C) 2025 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
 name: oci-pr-push
 
 on:
@@ -19,18 +35,18 @@ jobs:
       packages: write
     steps:
       - name: Download mapt assets
-        uses: actions/download-artifact@v4
+        uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
         with:
-          name: mapt
+          pattern: mapt-*
           run-id: ${{ github.event.workflow_run.id }}
           github-token: ${{ github.token }}
       
-      - name: Get mapt build informaiton
+      - name: Get mapt build information
         run: |
           echo "image=$(cat mapt-image)" >> "$GITHUB_ENV"
 
       - name: Log in to ghcr.io
-        uses: redhat-actions/podman-login@v1
+        uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
         with:
           registry: ghcr.io
           username: ${{ github.actor }}
@@ -49,4 +65,4 @@ jobs:
           podman manifest create ${{ env.image }}
           podman manifest add ${{ env.image }} docker://${{ env.image }}-arm64
           podman manifest add ${{ env.image }} docker://${{ env.image }}-amd64
-          podman manifest push --all ${{ env.image }}
+          podman manifest push --all ${{ env.image }}
\ No newline at end of file
diff --git a/Makefile b/Makefile
index f1a4cb456..166a87328 100644
--- a/Makefile
+++ b/Makefile
@@ -89,22 +89,38 @@ lint: $(TOOLS_BINDIR)/golangci-lint
 
 # Build the container image
 .PHONY: oci-build
-oci-build: clean
-	# ${CONTAINER_MANAGER} build -t $(IMG) -f oci/Containerfile .
+oci-build: clean oci-build-amd64 oci-build-arm64
+
+# Build for amd64 architecture only
+.PHONY: oci-build-amd64
+oci-build-amd64: clean
+	# Build the container image for amd64
 	${CONTAINER_MANAGER} build --platform linux/amd64 --manifest $(IMG)-amd64 -f oci/Containerfile .
+
+# Build for arm64 architecture only
+.PHONY: oci-build-arm64
+oci-build-arm64: clean
+	# Build the container image for arm64
 	${CONTAINER_MANAGER} build --platform linux/arm64 --manifest $(IMG)-arm64 -f oci/Containerfile .
 
-MAPT_SAVE ?= mapt
-.PHONY: oci-save 
-oci-save: ARM64D=$(shell ${CONTAINER_MANAGER} manifest inspect ${IMG}-arm64 | jq '.manifests[0].digest')
-oci-save: 
-	${CONTAINER_MANAGER} manifest annotate --arch amd64 $(IMG)-arm64 $(ARM64D)
+# Save images for amd64 architecture only
+.PHONY: oci-save-amd64
+oci-save-amd64:
 	${CONTAINER_MANAGER} save -m -o $(MAPT_SAVE)-amd64.tar $(IMG)-amd64
+
+# Save images for arm64 architecture only
+.PHONY: oci-save-arm64
+oci-save-arm64:
 	${CONTAINER_MANAGER} save -m -o $(MAPT_SAVE)-arm64.tar $(IMG)-arm64
 
+
+MAPT_SAVE ?= mapt
+.PHONY: oci-save 
+oci-save: oci-save-amd64 oci-save-arm64
+
 oci-load:
-	${CONTAINER_MANAGER} load -i $(MAPT_SAVE)-arm64.tar 
-	${CONTAINER_MANAGER} load -i $(MAPT_SAVE)-amd64.tar 
+	${CONTAINER_MANAGER} load -i $(MAPT_SAVE)-arm64/$(MAPT_SAVE)-arm64.tar 
+	${CONTAINER_MANAGER} load -i $(MAPT_SAVE)-amd64/$(MAPT_SAVE)-amd64.tar 
 
 # Push the docker image
 .PHONY: oci-push


Reviews:
user: login: adrianriobo
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T14:24:31Z
user: login: adrianriobo
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T13:38:13Z
user: login: adrianriobo
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T13:40:47Z
user: login: adrianriobo
body: LGTM
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-03-07T14:34:02Z
user: login: adrianriobo
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T14:58:54Z
user: login: rohanKanojia
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T15:04:07Z
user: login: adrianriobo
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T15:18:16Z
user: login: rohanKanojia
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-07T15:22:59Z

Review comments:
diff_hunk: @@ -9,53 +9,87 @@ on:
     branches: [ main ]
 
 jobs:
-  build:
-    name: build
+  build-amd64:
+    name: build-amd64
     runs-on: ubuntu-24.04
     steps:
-      - name: Prepare runner for build multi arch
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: Build image for PR
+        if: github.event_name == 'pull_request' 
+        env:
+          IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
         shell: bash
         run: |
-          sudo apt-get update && sudo apt-get install -y qemu-user-static
+          make oci-build-amd64
+          make oci-save-amd64
+          echo ${IMG} > mapt-image
+
+      - name: Build and Push image for Release
+        if: github.event_name == 'push'
+        run: |
+          make oci-build-amd64
+          make oci-save-amd64
 
+      - name: Upload mapt artifacts for PR
+        uses: actions/upload-artifact@v4
+        with:
+          name: mapt-amd64
+          path: |
+            mapt-image
+            mapt-amd64*
+  
+  build-arm64:
path: .github/workflows/build-oci.yaml
user: login: adrianriobo
body: I think you should be able to do this with matrix? https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow#using-a-matrix-strategy
created_at: 2025-03-06T14:24:07Z
author_association: COLLABORATOR
diff_hunk: @@ -9,56 +25,70 @@ on:
     branches: [ main ]
 
 jobs:
-  build:
-    name: build
-    runs-on: ubuntu-24.04
+  build-and-upload:
+    name: Build and Upload Images
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-24.04, ubuntu-24.04-arm]
     steps:
-      - name: Prepare runner for build multi arch
-        shell: bash
-        run: |
-          sudo apt-get update && sudo apt-get install -y qemu-user-static
-
       - name: Checkout code
-        uses: actions/checkout@v4
-
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+      - name: Install Podman (only for arm64)
+        if: contains(matrix.os, 'arm')
+        run: |
+          sudo apt-get update -y
+          sudo apt-get -y install podman
+      - name: Set environment variables based on architecture
+        run: |
+          if [[ "${{ matrix.os }}" == *"arm"* ]]; then
+            echo "ARCH_TYPE=arm64" >> $GITHUB_ENV
+          else
+            echo "ARCH_TYPE=amd64" >> $GITHUB_ENV
+          fi
       - name: Build image for PR
-        if: github.event_name == 'pull_request' 
+        if: github.event_name == 'pull_request'
         env:
           IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
         shell: bash
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
           echo ${IMG} > mapt-image
 
       - name: Build and Push image for Release
         if: github.event_name == 'push'
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
 
       - name: Upload mapt artifacts for PR
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
         with:
-          name: mapt
-          path: mapt*
+          name: mapt-${{ env.ARCH_TYPE }}
+          path: |
+            mapt-image
+            mapt-${{ env.ARCH_TYPE }}*
 
   push:
     name: push
-    if: github.event_name == 'push' 
path: .github/workflows/build-oci.yaml
user: login: adrianriobo
body: I think the `if: github.event_name == 'push' ` in the push action is needed otherwise it will try to push on PR and it fail due to credentials missing...actually this is the current failure you can see on the PR
created_at: 2025-03-07T13:38:09Z
author_association: COLLABORATOR
diff_hunk: @@ -19,18 +35,24 @@ jobs:
       packages: write
     steps:
       - name: Download mapt assets
-        uses: actions/download-artifact@v4
+        uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
         with:
-          name: mapt
+          name: mapt-amd64
+          run-id: ${{ github.event.workflow_run.id }}
+          github-token: ${{ github.token }}
+      - name: Download mapt assets
+        uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
+        with:
+          name: mapt-arm64
path: .github/workflows/push-oci-pr.yml
user: login: adrianriobo
body: I think you can use `pattern` instead so you can download both on the same action https://github.com/actions/download-artifact?tab=readme-ov-file#usage
created_at: 2025-03-07T13:40:43Z
author_association: COLLABORATOR
diff_hunk: @@ -9,56 +25,67 @@ on:
     branches: [ main ]
 
 jobs:
-  build:
-    name: build
-    runs-on: ubuntu-24.04
+  build-and-upload:
+    name: Build and Upload Images
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-24.04, ubuntu-24.04-arm]
     steps:
-      - name: Prepare runner for build multi arch
-        shell: bash
-        run: |
-          sudo apt-get update && sudo apt-get install -y qemu-user-static
-
       - name: Checkout code
-        uses: actions/checkout@v4
-
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+      - name: Install Podman (only for arm64)
+        if: contains(matrix.os, 'arm')
+        run: |
+          sudo apt-get update -y
+          sudo apt-get -y install podman
+      - name: Set environment variables based on architecture
+        run: |
+          if [[ "${{ matrix.os }}" == *"arm"* ]]; then
+            echo "ARCH_TYPE=arm64" >> $GITHUB_ENV
+          else
+            echo "ARCH_TYPE=amd64" >> $GITHUB_ENV
+          fi
       - name: Build image for PR
-        if: github.event_name == 'pull_request' 
+        if: github.event_name == 'pull_request'
         env:
           IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
         shell: bash
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
           echo ${IMG} > mapt-image
 
       - name: Build and Push image for Release
         if: github.event_name == 'push'
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
 
       - name: Upload mapt artifacts for PR
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
         with:
-          name: mapt
-          path: mapt*
+          name: mapt-${{ env.ARCH_TYPE }}
+          path: |
+            mapt-image
+            mapt-${{ env.ARCH_TYPE }}*
 
   push:
     name: push
-    if: github.event_name == 'push' 
-    needs: build
+    if: github.event_name == 'push'
+    needs: build-and-upload
     runs-on: ubuntu-24.04
     steps:
       - name: Checkout code
-        uses: actions/checkout@v4
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
 
-      - name: Download mapt oci flatten images
-        uses: actions/download-artifact@v4
+      - name: Download mapt amd64 oci flatten images
path: .github/workflows/build-oci.yaml
user: login: adrianriobo
body: typo: name contains the arch here
created_at: 2025-03-07T14:57:10Z
author_association: COLLABORATOR
diff_hunk: @@ -9,56 +25,67 @@ on:
     branches: [ main ]
 
 jobs:
-  build:
-    name: build
-    runs-on: ubuntu-24.04
+  build-and-upload:
+    name: Build and Upload Images
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-24.04, ubuntu-24.04-arm]
     steps:
-      - name: Prepare runner for build multi arch
-        shell: bash
-        run: |
-          sudo apt-get update && sudo apt-get install -y qemu-user-static
-
       - name: Checkout code
-        uses: actions/checkout@v4
-
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+      - name: Install Podman (only for arm64)
+        if: contains(matrix.os, 'arm')
+        run: |
+          sudo apt-get update -y
+          sudo apt-get -y install podman
+      - name: Set environment variables based on architecture
+        run: |
+          if [[ "${{ matrix.os }}" == *"arm"* ]]; then
+            echo "ARCH_TYPE=arm64" >> $GITHUB_ENV
+          else
+            echo "ARCH_TYPE=amd64" >> $GITHUB_ENV
+          fi
       - name: Build image for PR
-        if: github.event_name == 'pull_request' 
+        if: github.event_name == 'pull_request'
         env:
           IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
         shell: bash
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
           echo ${IMG} > mapt-image
 
       - name: Build and Push image for Release
         if: github.event_name == 'push'
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
 
       - name: Upload mapt artifacts for PR
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
         with:
-          name: mapt
-          path: mapt*
path: .github/workflows/build-oci.yaml
user: login: adrianriobo
body: I think you can keep this no?
created_at: 2025-03-07T14:58:49Z
author_association: COLLABORATOR
diff_hunk: @@ -9,56 +25,67 @@ on:
     branches: [ main ]
 
 jobs:
-  build:
-    name: build
-    runs-on: ubuntu-24.04
+  build-and-upload:
+    name: Build and Upload Images
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-24.04, ubuntu-24.04-arm]
     steps:
-      - name: Prepare runner for build multi arch
-        shell: bash
-        run: |
-          sudo apt-get update && sudo apt-get install -y qemu-user-static
-
       - name: Checkout code
-        uses: actions/checkout@v4
-
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+      - name: Install Podman (only for arm64)
+        if: contains(matrix.os, 'arm')
+        run: |
+          sudo apt-get update -y
+          sudo apt-get -y install podman
+      - name: Set environment variables based on architecture
+        run: |
+          if [[ "${{ matrix.os }}" == *"arm"* ]]; then
+            echo "ARCH_TYPE=arm64" >> $GITHUB_ENV
+          else
+            echo "ARCH_TYPE=amd64" >> $GITHUB_ENV
+          fi
       - name: Build image for PR
-        if: github.event_name == 'pull_request' 
+        if: github.event_name == 'pull_request'
         env:
           IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
         shell: bash
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
           echo ${IMG} > mapt-image
 
       - name: Build and Push image for Release
         if: github.event_name == 'push'
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
 
       - name: Upload mapt artifacts for PR
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
         with:
-          name: mapt
-          path: mapt*
path: .github/workflows/build-oci.yaml
user: login: rohanKanojia
body: As far as I remember I was getting an error in github action that it was trying to upload two artifacts with same name `mapt` . Now we're uploading two different artifacts for different architectures.
created_at: 2025-03-07T15:04:07Z
author_association: COLLABORATOR
diff_hunk: @@ -9,56 +25,67 @@ on:
     branches: [ main ]
 
 jobs:
-  build:
-    name: build
-    runs-on: ubuntu-24.04
+  build-and-upload:
+    name: Build and Upload Images
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-24.04, ubuntu-24.04-arm]
     steps:
-      - name: Prepare runner for build multi arch
-        shell: bash
-        run: |
-          sudo apt-get update && sudo apt-get install -y qemu-user-static
-
       - name: Checkout code
-        uses: actions/checkout@v4
-
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+      - name: Install Podman (only for arm64)
+        if: contains(matrix.os, 'arm')
+        run: |
+          sudo apt-get update -y
+          sudo apt-get -y install podman
+      - name: Set environment variables based on architecture
+        run: |
+          if [[ "${{ matrix.os }}" == *"arm"* ]]; then
+            echo "ARCH_TYPE=arm64" >> $GITHUB_ENV
+          else
+            echo "ARCH_TYPE=amd64" >> $GITHUB_ENV
+          fi
       - name: Build image for PR
-        if: github.event_name == 'pull_request' 
+        if: github.event_name == 'pull_request'
         env:
           IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
         shell: bash
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
           echo ${IMG} > mapt-image
 
       - name: Build and Push image for Release
         if: github.event_name == 'push'
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
 
       - name: Upload mapt artifacts for PR
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
         with:
-          name: mapt
-          path: mapt*
path: .github/workflows/build-oci.yaml
user: login: adrianriobo
body: sorry I meant for the `path` name should be as you said 

```
name: mapt-${env.ARCH}
path: mapt*
```
created_at: 2025-03-07T15:18:16Z
author_association: COLLABORATOR
diff_hunk: @@ -9,56 +25,67 @@ on:
     branches: [ main ]
 
 jobs:
-  build:
-    name: build
-    runs-on: ubuntu-24.04
+  build-and-upload:
+    name: Build and Upload Images
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-24.04, ubuntu-24.04-arm]
     steps:
-      - name: Prepare runner for build multi arch
-        shell: bash
-        run: |
-          sudo apt-get update && sudo apt-get install -y qemu-user-static
-
       - name: Checkout code
-        uses: actions/checkout@v4
-
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+      - name: Install Podman (only for arm64)
+        if: contains(matrix.os, 'arm')
+        run: |
+          sudo apt-get update -y
+          sudo apt-get -y install podman
+      - name: Set environment variables based on architecture
+        run: |
+          if [[ "${{ matrix.os }}" == *"arm"* ]]; then
+            echo "ARCH_TYPE=arm64" >> $GITHUB_ENV
+          else
+            echo "ARCH_TYPE=amd64" >> $GITHUB_ENV
+          fi
       - name: Build image for PR
-        if: github.event_name == 'pull_request' 
+        if: github.event_name == 'pull_request'
         env:
           IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
         shell: bash
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
           echo ${IMG} > mapt-image
 
       - name: Build and Push image for Release
         if: github.event_name == 'push'
         run: |
-          make oci-build
-          make oci-save
+          make oci-build-${{ env.ARCH_TYPE }}
+          make oci-save-${{ env.ARCH_TYPE }}
 
       - name: Upload mapt artifacts for PR
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
         with:
-          name: mapt
-          path: mapt*
path: .github/workflows/build-oci.yaml
user: login: rohanKanojia
body: Oh, I see. You're right. Let me update it as per your suggestion.
created_at: 2025-03-07T15:22:59Z
author_association: COLLABORATOR

PR comments:
user: login: rohanKanojia
created_at: 2025-03-07T14:47:31Z
body: Please wait I'm seeing a failure on one of the runs on my fork https://github.com/rohankanojia-forks/mapt/actions/runs/13722854013 . Let me double check it then you can merge.
author_association: COLLABORATOR
user: login: adrianriobo
created_at: 2025-03-07T15:40:32Z
body: Now it seems good no??? really great moving from 40 mins to build to 10 mins :rocket: 

feel free to `rebase and merge` at your discretion I keep the LGTM
author_association: COLLABORATOR
user: login: rohanKanojia
created_at: 2025-03-07T15:44:50Z
body: okay, on my fork it's passing now https://github.com/rohankanojia-forks/mapt/actions/runs/13723908545/job/38386161379 . 

I think it's okay to merge now. If some issue arises, I'll create a follow up PR to fix it.
author_association: COLLABORATOR