Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
* Use tags for build-kit-<reponame>
* Don't support multi platform build

Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
  • Loading branch information
andistorm committed Oct 25, 2024
1 parent 58a1b97 commit 033e6e0
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 033e6e0

Please sign in to comment.