From 0085ab3750fc2a43844ddedbc5cc25c2295b18a5 Mon Sep 17 00:00:00 2001 From: erikzaadi Date: Tue, 15 Oct 2024 15:45:08 +0300 Subject: [PATCH] No more github action cache for docker builds --- .github/workflows/ci.yml | 30 ++++++++++++++-------- .github/workflows/release-integrations.yml | 2 -- integrations/_infra/Dockerfile.Deb | 3 ++- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea47a71ffa..a6854b9e03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,8 @@ jobs: build-integration: - runs-on: ubuntu-latest + runs-on: ${{ matrix.platform == 'linux/arm64' && 'macos-13' || 'ubuntu-latest' }} + # runs-on: 'ubuntu-latest' if: needs.prepare-matrix.outputs.matrix != '[]' outputs: is_dev_version: ${{ steps.prepare_tags.outputs.is_dev_version }} @@ -57,10 +58,14 @@ jobs: - name: Check out code uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: ${{ matrix.platform }} + - name: Setup docker (missing on MacOS) + if: matrix.platform == 'linux/arm64' + uses: douglascamata/setup-docker-macos-action@v1-alpha + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + # with: + # platforms: ${{ matrix.platform }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -106,10 +111,17 @@ jobs: run: | echo "base_image=$(cat ${{ steps.prepare_tags.outputs.dockerfile_path }} | head -n 1 | awk -F '=' '{print $2}' )" >> $GITHUB_OUTPUT - - name: Cache Docker images - uses: ScribeMD/docker-cache@0.5.0 + - name: Login to Docker Hub + uses: docker/login-action@v3 with: - key: docker-${{ matrix.integration }}-${{ steps.get-docker-image.outputs.base_image }}-${{ matrix.platform }} + registry: ghcr.io + username: ${{ secrets.DOCKER_MACHINE_USER }} + password: ${{ secrets.DOCKER_MACHINE_TOKEN }} + + # - name: Cache Docker images + # uses: ScribeMD/docker-cache@0.5.0 + # with: + # key: docker-${{ matrix.integration }}-${{ steps.get-docker-image.outputs.base_image }}-${{ matrix.platform }} - name: Build uses: docker/build-push-action@v6 @@ -119,8 +131,6 @@ jobs: platforms: ${{ matrix.platform }} push: false load: true - cache-from: type=gha - cache-to: type=gha,mode=max tags: ${{ steps.prepare_tags.outputs.tags }} build-args: | BUILD_CONTEXT=${{ steps.prepare_tags.outputs.context_dir }} diff --git a/.github/workflows/release-integrations.yml b/.github/workflows/release-integrations.yml index f79a312754..1cef14d6b7 100644 --- a/.github/workflows/release-integrations.yml +++ b/.github/workflows/release-integrations.yml @@ -115,8 +115,6 @@ jobs: file: ${{ steps.prepare_tags.outputs.dockerfile_path }} platforms: linux/amd64,linux/arm64 push: true - cache-from: type=gha - cache-to: type=gha,mode=max tags: ${{ steps.prepare_tags.outputs.tags }} build-args: | BUILD_CONTEXT=${{ steps.prepare_tags.outputs.context_dir }} diff --git a/integrations/_infra/Dockerfile.Deb b/integrations/_infra/Dockerfile.Deb index 9c881105a5..eebce4cda5 100644 --- a/integrations/_infra/Dockerfile.Deb +++ b/integrations/_infra/Dockerfile.Deb @@ -12,6 +12,7 @@ ENV LIBRDKAFKA_VERSION=1.9.2 \ RUN apt-get update \ && apt-get install -y \ + --no-install-recommends \ wget \ g++ \ libssl-dev \ @@ -45,7 +46,7 @@ LABEL org.opencontainers.image.source=https://github.com/port-labs/ocean ENV PIP_ROOT_USER_ACTION=ignore RUN apt-get update \ - && apt-get install -y librdkafka-dev python3 \ + && apt-get install -y --no-install-recommends librdkafka-dev python3 \ && apt-get clean WORKDIR /app