refactor: remove CACHE_FROM and CACHE_TO

Having these in the `vars` step provides little benefit going forward.  Moving them to the `build-push` step improves the readability.

PR: #20
This commit is contained in:
innovaker 2021-05-09 22:35:42 +01:00
parent a8cc84717b
commit 3f5e23723c

View File

@ -39,11 +39,6 @@ jobs:
NAME=zmk-${{ matrix.target }}-${{ matrix.architecture }} NAME=zmk-${{ matrix.target }}-${{ matrix.architecture }}
echo ::set-output name=name::${NAME} echo ::set-output name=name::${NAME}
CACHE_FROM=${{ env.cache-repository-name }}:dev
CACHE_TO=${{ env.cache-repository-name }}:${{ matrix.target }}
echo ::set-output name=cache-from::${CACHE_FROM}
echo ::set-output name=cache-to::${CACHE_TO}
CANDIDATE_TAG=${NAME}:${{ github.sha }} CANDIDATE_TAG=${NAME}:${{ github.sha }}
echo ::set-output name=candidate-tag::${CANDIDATE_TAG} echo ::set-output name=candidate-tag::${CANDIDATE_TAG}
@ -80,8 +75,8 @@ jobs:
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
tags: | tags: |
docker.io/${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ steps.vars.outputs.candidate-tag }} docker.io/${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ steps.vars.outputs.candidate-tag }}
cache-from: type=registry,ref=docker.io/${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ steps.vars.outputs.cache-from }} cache-from: type=registry,ref=docker.io/${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ env.cache-repository-name }}:dev
cache-to: type=registry,ref=docker.io/${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ steps.vars.outputs.cache-to }},mode=max cache-to: type=registry,ref=docker.io/${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ env.cache-repository-name }}:${{ matrix.target }},mode=max
push: true push: true
- name: Image digest - name: Image digest
if: ${{ !startsWith(github.ref, 'refs/tags') }} if: ${{ !startsWith(github.ref, 'refs/tags') }}