Fix build caching by base image.
This commit is contained in:
parent
d028a2c343
commit
de0bd653d4
6
.github/workflows/docker-build.yml
vendored
6
.github/workflows/docker-build.yml
vendored
@ -26,13 +26,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
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
|
- name: cache docker cache
|
||||||
uses: actions/cache@v2.1.1
|
uses: actions/cache@v2.1.1
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/cache
|
path: ${{ github.workspace }}/cache
|
||||||
key: ${{ runner.os }}-docker-${{ hashFiles('**/requirements.txt') }}
|
key: ${{ runner.os }}-docker-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/dockerhash.txt') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-docker-${{ hashFiles('**/requirements.txt') }}
|
${{ runner.os }}-docker-
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
|
Reference in New Issue
Block a user