diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 76051837..00000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Check image building - -on: - - pull_request - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: read - steps: - - uses: actions/checkout@v4 - - name: Install podman - run: | - sudo apt-get update - sudo apt-get -y install podman - - name: Verify podman - run: podman --version - - name: Build image - run: podman build -t lightspeed-stack:latest . - diff --git a/.github/workflows/build_and_push_dev.yaml b/.github/workflows/build_and_push_dev.yaml index 9ab2a04e..c916d387 100644 --- a/.github/workflows/build_and_push_dev.yaml +++ b/.github/workflows/build_and_push_dev.yaml @@ -22,7 +22,8 @@ jobs: - name: Install buildah run: | sudo apt update - sudo apt install -y buildah + # qemu is required for arm64 builds + sudo apt install -y buildah qemu-user-static - name: Checkout code uses: actions/checkout@v4 - name: Create dev image tag @@ -35,12 +36,20 @@ jobs: with: image: ${{ env.IMAGE_NAME }} tags: | - ${{ env.DEV_TAG }} ${{ env.LATEST_TAG }} containerfiles: | ${{ env.CONTAINER_FILE }} + archs: amd64, arm64 oci: true - + - name: Check images + run: | + buildah images | grep '${{ env.IMAGE_NAME }}' + echo '${{ steps.build_image.outputs.image }}' + echo '${{ steps.build_image.outputs.tags }}' + - name: Check manifest + run: | + set -x + buildah manifest inspect ${{ steps.build_image.outputs.image }}:${{ env.LATEST_TAG }} - name: Push image to Quay.io uses: redhat-actions/push-to-registry@v2 with: diff --git a/.github/workflows/build_pr.yaml b/.github/workflows/build_pr.yaml new file mode 100644 index 00000000..b24dff1b --- /dev/null +++ b/.github/workflows/build_pr.yaml @@ -0,0 +1,46 @@ +name: Check image building + +on: + - pull_request + +env: + IMAGE_NAME: lightspeed-stack + IMAGE_NAMESPACE: lightspeed-core + LATEST_TAG: dev-latest + CONTAINER_FILE: Containerfile + +jobs: + build-pr: + runs-on: ubuntu-latest + permissions: + contents: read + # Required for image pushing to a registry + packages: write + steps: + - name: Install qemu and buildah + run: | + sudo apt update + # qemu is required for arm64 builds + sudo apt install -y buildah qemu-user-static + - name: Checkout code + uses: actions/checkout@v4 + - name: Build image with Buildah + id: build_image + uses: redhat-actions/buildah-build@v2 + with: + image: ${{ env.IMAGE_NAME }} + tags: | + ${{ env.LATEST_TAG }} + containerfiles: | + ${{ env.CONTAINER_FILE }} + archs: amd64, arm64 + oci: true + - name: Check images + run: | + buildah images | grep '${{ env.IMAGE_NAME }}' + echo '${{ steps.build_image.outputs.image }}' + echo '${{ steps.build_image.outputs.tags }}' + - name: Check manifest + run: | + set -x + buildah manifest inspect ${{ steps.build_image.outputs.image }}:${{ env.LATEST_TAG }}