From 425a57f40ee235875e0bff484030949111537d6d Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Sun, 3 Nov 2024 14:24:39 -0500 Subject: [PATCH] Add docker build caching Signed-off-by: Jason Cameron --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d8181a..0256a6e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,12 +41,14 @@ jobs: # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - name: Build and push Docker image id: push - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + uses: docker/build-push-action@v5 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=ghcr.io/mcpt/sentinel:buildcache + cache-to: type=registry,ref=ghcr.io/mcpt/sentinel:buildcache,mode=max # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." - name: Generate artifact attestation