Skip to content

Commit

Permalink
Cache docker build in kind workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Dec 9, 2024
1 parent e9317e7 commit d9d43b4
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,33 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup BATS
uses: mig4/setup-bats@af9a00deb21b5d795cabfeaa8d9060410377686d # v1
- name: Build sample app from script
if: ${{ hashFiles(format('internal/test/e2e/{0}/build.sh', matrix.library)) != '' }}
run: ./internal/test/e2e/${{ matrix.library }}/build.sh -t sample-app:latest
- name: Build sample app
- 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: Build and push local
if: ${{ hashFiles(format('internal/test/e2e/{0}/build.sh', matrix.library)) == '' }}
working-directory: ./internal/test/e2e/${{ matrix.library }}
run: docker build -t sample-app:latest .
uses: docker/build-push-action@v5
with:
context: ./internal/test/e2e/${{ matrix.library }}
push: true
tags: "sample-app:latest,go.opentelemetry.io/auto-test-${{ matrix.library }}:latest"
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push global
if: ${{ hashFiles(format('internal/test/e2e/{0}/build.sh', matrix.library)) != '' }}
uses: docker/build-push-action@v5
with:
context: ./internal/test/e2e/${{ matrix.library }}
push: true
tags: "sample-app:latest,go.opentelemetry.io/auto-test-${{ matrix.library }}:latest"
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4
with:
Expand Down

0 comments on commit d9d43b4

Please sign in to comment.