Skip to content

Commit

Permalink
No more github action cache for docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzaadi committed Oct 20, 2024
1 parent cec3e26 commit 0085ab3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -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[email protected]
- 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/[email protected]
# with:
# key: docker-${{ matrix.integration }}-${{ steps.get-docker-image.outputs.base_image }}-${{ matrix.platform }}

- name: Build
uses: docker/build-push-action@v6
Expand All @@ -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 }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion integrations/_infra/Dockerfile.Deb
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0085ab3

Please sign in to comment.