Skip to content

Commit 82c72b6

Browse files
committed
1 parent 8c6a0aa commit 82c72b6

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

.github/workflows/docker.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ jobs:
3030
- name: Set up QEMU
3131
uses: docker/setup-qemu-action@v2
3232

33-
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache
34-
- name: Cache Docker layers
35-
uses: actions/cache@v3
36-
with:
37-
path: /tmp/.buildx-cache
38-
key: ${{ runner.os }}-buildx-${{ github.sha }}
39-
restore-keys: |
40-
${{ runner.os }}-buildx-
41-
4233
# https://stackoverflow.com/questions/59810838/how-to-get-the-short-sha-for-the-github-workflow
4334
# https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions
4435
- name: Add SHORT_SHA and BRANCH to env
@@ -60,8 +51,8 @@ jobs:
6051
${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:latest ,
6152
${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:${{ env.SHORT_SHA }} ,
6253
${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:${{ env.BRANCH }}
63-
cache-from: type=gha,scope=${{ github.workflow }}
64-
cache-to: type=gha,scope=${{ github.workflow }},mode=max
54+
cache-from: type=registry,ref=${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:${{ env.BRANCH }}
55+
cache-to: type=registry,ref=${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:${{ env.BRANCH }},mode=max
6556

6657
- name: Build and push ${{ env.image-fetcher }}
6758
uses: docker/build-push-action@v3
@@ -74,8 +65,8 @@ jobs:
7465
${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-fetcher }}:latest ,
7566
${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-fetcher }}:${{ env.SHORT_SHA }} ,
7667
${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-fetcher }}:${{ env.BRANCH }}
77-
cache-from: type=gha,scope=${{ github.workflow }}
78-
cache-to: type=gha,scope=${{ github.workflow }},mode=max
68+
cache-from: type=registry,ref=${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:release
69+
cache-to: type=registry,ref=${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:release,mode=max
7970

8071
release:
8172
name: Release to Azure Pipelines Production

0 commit comments

Comments
 (0)