From de0bd653d4f47bc817be87452e2d8c073db17dcd Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 11 Oct 2020 00:42:03 +0530 Subject: [PATCH] Fix build caching by base image. --- .github/workflows/docker-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 615ebcc..0e93720 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -26,13 +26,15 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get hash of latest image + run: docker pull python:3-alpine && docker inspect --format='{{index .RepoDigests 0}}' ytorg/yotter:latest > dockerhash.txt - name: cache docker cache uses: actions/cache@v2.1.1 with: path: ${{ github.workspace }}/cache - key: ${{ runner.os }}-docker-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-docker-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/dockerhash.txt') }} restore-keys: | - ${{ runner.os }}-docker-${{ hashFiles('**/requirements.txt') }} + ${{ runner.os }}-docker- - name: Build and push uses: docker/build-push-action@v2 with: