diff --git a/.github/actions/docker-custom-build-and-push/action.yml b/.github/actions/docker-custom-build-and-push/action.yml index 1e0054503c17d..96d4d759dbb84 100644 --- a/.github/actions/docker-custom-build-and-push/action.yml +++ b/.github/actions/docker-custom-build-and-push/action.yml @@ -49,7 +49,7 @@ runs: # add git short SHA as Docker tag tag-custom: ${{ inputs.tags }} tag-custom-only: true - + # Code for testing the build when not pushing to Docker Hub. - name: Build and Load image for testing (if not publishing) uses: docker/build-push-action@v3 @@ -64,12 +64,14 @@ runs: tags: ${{ steps.docker_meta.outputs.tags }} load: true push: false + cache-from: type=registry,ref=${{ steps.docker_meta.outputs.tags }} + cache-to: type=inline - name: Upload image locally for testing (if not publishing) uses: ishworkh/docker-image-artifact-upload@v1 if: ${{ inputs.publish != 'true' }} with: image: ${{ steps.docker_meta.outputs.tags }} - + # Code for building multi-platform images and pushing to Docker Hub. - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -93,5 +95,7 @@ runs: build-args: ${{ inputs.build-args }} tags: ${{ steps.docker_meta.outputs.tags }} push: true + cache-from: type=registry,ref=${{ steps.docker_meta.outputs.tags }} + cache-to: type=inline # TODO add code for vuln scanning?