Skip to content

Commit

Permalink
Manage caches more carefully
Browse files Browse the repository at this point in the history
  • Loading branch information
doganulus committed Jul 19, 2024
1 parent d386352 commit f7c06a9
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/builder-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,27 @@ jobs:
- name: Build builder image
uses: docker/build-push-action@v6
with:
# platforms: linux/amd64,linux/arm64
context: .
target: autoware-builder
build-args: |
"AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}"
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.AUTOWARE_VERSION }}-builder
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-builder
cache-to: type=inline

- name: Build builder w/cache image
uses: docker/build-push-action@v6
with:
# platforms: linux/amd64,linux/arm64
context: .
target: autoware-builder-with-cache
build-args: |
"AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}"
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-builder-with-cache
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.AUTOWARE_VERSION }}-builder-with-cache
load: true
# push: true
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.AUTOWARE_VERSION }}-builder

# Push the builder image to the registry
- name: Push builder image
Expand All @@ -95,3 +90,15 @@ jobs:
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-builder
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.AUTOWARE_VERSION }}-builder
push: true

- name: Push builder-with-cache image
uses: docker/build-push-action@v6
with:
context: .
target: autoware-builder-with-cache
build-args: |
"AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}"
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-builder-with-cache
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.AUTOWARE_VERSION }}-builder-with-cache
push: true

0 comments on commit f7c06a9

Please sign in to comment.