Skip to content

Commit a2e4baa

Browse files
committed
gh action docker build optimizations
1 parent 62a276a commit a2e4baa

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
check-latest: true
3636

3737
- name: Set up Docker Buildx
38-
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
38+
uses: docker/setup-buildx-action@v3
3939

4040
- name: Login to Docker Hub
4141
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
@@ -51,6 +51,7 @@ jobs:
5151
args: release
5252
env:
5353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
BUILDKIT_INLINE_CACHE: 1
5455

5556
helm:
5657
needs: release

.github/workflows/test-integration.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,25 @@ jobs:
3434
- name: Build worker-controller image
3535
run: |
3636
skaffold build --profile worker-controller --push=false
37+
env:
38+
DOCKER_BUILDKIT: 1
39+
BUILDKIT_PROGRESS: plain
3740

3841
- name: Build helloworld worker image
3942
run: |
4043
skaffold build --profile helloworld-worker --push=false
44+
env:
45+
DOCKER_BUILDKIT: 1
46+
BUILDKIT_PROGRESS: plain
4147

4248
# Verify that the demo worker patch applies successfully and builds.
4349
- name: Build helloworld worker image patch
4450
run: |
4551
git apply internal/demo/helloworld/changes/no-version-gate.patch
4652
skaffold build --profile helloworld-worker --push=false
53+
env:
54+
DOCKER_BUILDKIT: 1
55+
BUILDKIT_PROGRESS: plain
4756

4857
test-integration:
4958
name: Run Integration Tests

.goreleaser.main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ dockers:
4242
use: buildx
4343
build_flag_templates:
4444
- --platform=linux/amd64
45+
- --cache-from=type=gha,scope=amd64
46+
- --cache-to=type=gha,mode=max,scope=amd64
4547
- --label=org.opencontainers.image.title={{ .ProjectName }}
4648
- --label=org.opencontainers.image.description=Temporal Worker Controller for Kubernetes
4749
- --label=org.opencontainers.image.url=https://github.com/temporalio/temporal-worker-controller
@@ -63,6 +65,8 @@ dockers:
6365
use: buildx
6466
build_flag_templates:
6567
- --platform=linux/arm64
68+
- --cache-from=type=gha,scope=arm64
69+
- --cache-to=type=gha,mode=max,scope=arm64
6670
- --label=org.opencontainers.image.title={{ .ProjectName }}
6771
- --label=org.opencontainers.image.description=Temporal Worker Controller for Kubernetes
6872
- --label=org.opencontainers.image.url=https://github.com/temporalio/temporal-worker-controller

skaffold.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ profiles:
1919
context: .
2020
docker:
2121
dockerfile: Dockerfile
22+
useBuildkit: true
2223
manifests:
2324
helm:
2425
releases:
@@ -46,6 +47,7 @@ profiles:
4647
DD_GIT_COMMIT_SHA: "{{ .IMAGE_TAG }}"
4748
DD_GIT_REPOSITORY_URL: "github.com/temporalio/temporal-worker-controller"
4849
WORKER: "helloworld"
50+
useBuildkit: true
4951
manifests:
5052
helm:
5153
releases:

0 commit comments

Comments
 (0)