From 033e6e07cd66f05efd44771e9be515e14a2b9dbe Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Fri, 25 Oct 2024 10:30:29 +0200 Subject: [PATCH] Changes * Use tags for build-kit- * Don't support multi platform build Signed-off-by: Andreas Heinrich --- .github/workflows/continuous_integration.yml | 34 +++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 9d01b75..dde78ab 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -258,11 +258,10 @@ jobs: - setup-env env: BUILD_KIT_IMAGE_NAME: local/build-kit-${{ github.event.repository.name }} - PLATFORMS: linux/amd64 BUILD_ARGS: | BASE_IMAGE_TAG=${{ needs.setup-env.outputs.tag_everest_ci }} outputs: - build_kit_image_name: ${{ env.BUILD_KIT_IMAGE_NAME }} + build_kit_image_tag: ${{ steps.set-outputs.outputs.tag }} steps: - name: Checkout Dockerfile uses: actions/checkout@v4 @@ -272,29 +271,40 @@ jobs: ref: ${{ github.ref }} token: ${{ github.token}} fetch-depth: 0 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: Docker Meta + id: meta + uses: docker/metadata-action@v5 with: - image: tonistiigi/binfmt:latest - platforms: ${{ env.PLATFORMS }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + images: ${{ env.BUILD_KIT_IMAGE_NAME }} - name: Build uses: docker/build-push-action@v6 with: context: source/${{ inputs.build_kit_docker_directory }} push: false - platforms: ${{ env.PLATFORMS }} cache-from: type=gha cache-to: type=gha,mode=max build-args: ${{ env.BUILD_ARGS }} - tags: ${{ env.BUILD_KIT_IMAGE_NAME }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} outputs: type=docker,dest=build-kit.tar - name: Upload build-kit image uses: actions/upload-artifact@v4 with: name: build-kit path: build-kit.tar + - name: Set output tag + id: set-outputs + shell: python3 {0} + run: | + import os + tags = "${{ steps.meta.outputs.tags }}".split(",") + if len(tags) == 0: + print("No tags found!❌") + exit(1) + tag = tags[0] + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + f.write(f"tag={tag}\n") + print(f"Set tag={tag}") build: name: Build, Unit Tests and Install @@ -303,7 +313,7 @@ jobs: - build-build-kit runs-on: ${{ inputs.runner }} env: - BUILD_KIT_IMAGE: ${{ needs.build-build-kit.outputs.build_kit_image_name }} + BUILD_KIT_IMAGE: ${{ needs.build-build-kit.outputs.build_kit_image_tag }} steps: - name: Checkout local github actions uses: actions/checkout@v3 @@ -438,7 +448,7 @@ jobs: - build - build-build-kit env: - BUILD_KIT_IMAGE: ${{ needs.build-build-kit.outputs.build_kit_image_name }} + BUILD_KIT_IMAGE: ${{ needs.build-build-kit.outputs.build_kit_image_tag }} runs-on: ${{ inputs.runner }} if: ${{ inputs.run_integration_tests == 'true' }} steps: