From 79bd3d31085b24c77c7fdb5652c4938d86fa0494 Mon Sep 17 00:00:00 2001 From: jodybro Date: Tue, 12 Dec 2023 16:35:01 -0500 Subject: [PATCH 1/2] Use docker cache --- .github/workflows/pipeline.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 9f721e2..08f2d46 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -33,6 +33,17 @@ jobs: echo ::set-output name=tag::${TAG} echo ::set-output name=image::${IMAGE} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Log in to GHCR if: github.event_name != 'pull_request' uses: docker/login-action@v1 @@ -42,7 +53,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: context: . file: ./Dockerfile @@ -50,3 +61,6 @@ jobs: tags: ${{ steps.prep.outputs.tagged_image }},${{ steps.prep.outputs.image }}:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + From fabca0585fee5a9c0b9c5001fe3a2848fda0a532 Mon Sep 17 00:00:00 2001 From: jodybro Date: Tue, 12 Dec 2023 16:48:55 -0500 Subject: [PATCH 2/2] Use docker cache from gha --- .github/workflows/pipeline.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 08f2d46..0a150df 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -61,6 +61,5 @@ jobs: tags: ${{ steps.prep.outputs.tagged_image }},${{ steps.prep.outputs.image }}:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - + cache-from: type=gha + cache-to: type=gha,mode=max