ci: Cross build docker images for arm64 too.
On push on main branch, inspektor-gadget images will be built for both amd64 and
arm64.
@@ -161,6 +161,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+ if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
@@ -200,6 +203,9 @@ jobs:
tags: ${{ secrets.CONTAINER_REPO }}:${{ env.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
+ # For the moment, we only support these two platforms.
+ # Cross building for arm64 only happens on main branch.
+ platforms: ${{ fromJSON('["linux/amd64", "linux/amd64,linux/arm64"]')[github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')] }}
build-gadget-core-container-image:
name: Build gadget CO-RE container image
@@ -207,6 +213,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+ if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
@@ -246,6 +255,9 @@ jobs:
tags: ${{ secrets.CONTAINER_REPO }}:${{ env.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
+ # For the moment, we only support these two platforms.
+ # Cross building for arm64 only happens on main branch.
+ platforms: ${{ fromJSON('["linux/amd64", "linux/amd64,linux/arm64"]')[github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')] }}
build-examples:
name: Build examples
