Add Docker layer caching

This commit is contained in:
Seth Simmons
2021-03-24 12:38:52 -04:00
parent 47c3d74ae1
commit 16ea8d524a
2 changed files with 36 additions and 0 deletions

View File

@@ -11,6 +11,14 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
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: Login to GitHub Container Registry
uses: docker/login-action@v1
@@ -41,6 +49,16 @@ jobs:
ghcr.io/sethsimmons/simple-monerod-docker/simple-monerod:${{ steps.get_tag.outputs.tag }}
sethsimmons/simple-monerod:latest
sethsimmons/simple-monerod:${{ steps.get_tag.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
-
# 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: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}