Skip to content

Commit

Permalink
Cache the auto-instrumentation image build
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Dec 10, 2024
1 parent af40a1d commit 7300ac7
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,24 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Build auto-instrumentation
run: |
IMG=otel-go-instrumentation:latest make docker-build
docker save otel-go-instrumentation:latest -o otel-go-instrumentation.tar
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-
- name: Docker build
uses: docker/build-push-action@v5
with:
context: .
tags: "otel-go-instrumentation:latest"
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
outputs: type=tar,dest=otel-go-instrumentation.tar
- name: Upload Docker image artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
Expand All @@ -42,9 +56,9 @@ jobs:
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ github.sha }}
key: ${{ runner.os }}-docker-${{ matrix.library }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-
${{ runner.os }}-docker-${{ matrix.library }}-
- name: Build and push local
if: ${{ hashFiles(format('internal/test/e2e/{0}/build.sh', matrix.library)) == '' }}
uses: docker/build-push-action@v5
Expand Down

0 comments on commit 7300ac7

Please sign in to comment.