Skip to content

Commit

Permalink
feat(ci): use docker registry cache (#8544)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Aug 2, 2023
1 parent 637a6ae commit e157992
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/actions/docker-custom-build-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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?

0 comments on commit e157992

Please sign in to comment.