From 6d251b4a8fcddfd801411307f5caadea0f262e84 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Sat, 15 Jan 2022 18:22:46 -0500 Subject: [PATCH] update docker caching --- .github/linters/.markdown-lint.yml | 4 ++++ .github/workflows/docker-build-and-push.yml | 18 ++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index ab67716..aef4e33 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -1,3 +1,7 @@ # MD013/line-length - Line length MD013: + # Number of characters + line_length: 150 + # Number of characters for headings + heading_line_length: 100 code_blocks: false \ No newline at end of file diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index 1ee9c89..cb58500 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -71,8 +71,8 @@ jobs: with: # list of Docker images to use as base name for tags images: | - bretfisher/shpod - ghcr.io/bretfisher/shpod + ${{ github.repository }} + ghcr.io/${{ github.repository }} flavor: | latest=false tags: | @@ -88,20 +88,14 @@ jobs: # had to remove linux/arm/v7 due to missing docker image platforms: linux/amd64,linux/arm64,linux/arm/v7 builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new + # it uses github cache API for faster builds: + # https://github.com/crazy-max/docker-build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api + cache-from: type=gha + cache-to: type=gha,mode=max # for an approved pull_request, only push pr-specific tags push: true tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} - - - # Temp fix - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: Show image digest run: echo ${{ steps.docker_build.outputs.digest }}