Fix image cache

This commit is contained in:
Shkar T. Noori 2022-02-14 10:14:32 +00:00
parent c6397047b7
commit f8fcda04fb
No known key found for this signature in database
GPG Key ID: E7AD76088FB6FE02
2 changed files with 6 additions and 8 deletions

View File

@ -17,12 +17,10 @@ jobs:
name: Setup name: Setup
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
env: env:
IMAGE_REPO: reg.dev.krd/dit-docs/dsm-client IMAGE: "reg.dev.krd/dit-docs/dsm-client:${{ github.ref_name }}"
steps: steps:
- name: Extract image name - name: Extract image name
run: | run: echo "Using image name $IMAGE"
REF_NAME=$(echo ${GITHUB_REF##*/})
echo "IMAGE=$IMAGE_REPO:$REF_NAME" >> $GITHUB_ENV
outputs: outputs:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
image-sha: ${{ env.IMAGE }}-${{ github.sha }} image-sha: ${{ env.IMAGE }}-${{ github.sha }}
@ -53,8 +51,8 @@ jobs:
tags: |- tags: |-
${{ needs.setup.outputs.image }} ${{ needs.setup.outputs.image }}
${{ needs.setup.outputs.image-sha }} ${{ needs.setup.outputs.image-sha }}
cache-from: type=registry,ref=${{ needs.setup.outputs.image }}-buildcache cache-from: type=registry,ref=${{ needs.setup.outputs.image }}
cache-to: type=registry,ref=${{ needs.setup.outputs.image }}-buildcache,mode=max cache-to: type=inline
deploy: deploy:
uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@dev uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@dev

View File

@ -51,8 +51,8 @@ jobs:
tags: |- tags: |-
${{ needs.setup.outputs.image }} ${{ needs.setup.outputs.image }}
${{ needs.setup.outputs.image-sha }} ${{ needs.setup.outputs.image-sha }}
cache-from: type=registry,ref=${{ needs.setup.outputs.image }}-buildcache cache-from: type=registry,ref=${{ needs.setup.outputs.image }}
cache-to: type=registry,ref=${{ needs.setup.outputs.image }}-buildcache,mode=max cache-to: type=inline
deploy: deploy:
uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@main uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@main