Use github cache for docker layers (#1164)

Cache the build layers between github action builds to reduce time
required.
This commit is contained in:
Darragh Bailey
2020-10-27 10:09:49 +00:00
committed by GitHub
parent 4adc24b8e6
commit b657f7c709

View File

@@ -56,7 +56,14 @@ jobs:
uses: docker/setup-buildx-action@v1
with:
driver-opts: image=moby/buildkit:master
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Check have credentials
id: have_credentials
@@ -87,6 +94,8 @@ jobs:
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}