Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache docker builds #1395

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Cache the auto-instrumentation image build
MrAlias committed Dec 10, 2024
commit 7300ac755aa501d7be537d86cf43c26ec443c0bf
26 changes: 20 additions & 6 deletions .github/workflows/kind.yml
Original file line number Diff line number Diff line change
@@ -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:
@@ -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