|
30 | 30 | - name: Set up QEMU |
31 | 31 | uses: docker/setup-qemu-action@v2 |
32 | 32 |
|
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 | | -
|
42 | 33 | # https://stackoverflow.com/questions/59810838/how-to-get-the-short-sha-for-the-github-workflow |
43 | 34 | # https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions |
44 | 35 | - name: Add SHORT_SHA and BRANCH to env |
|
60 | 51 | ${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:latest , |
61 | 52 | ${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-nginx }}:${{ env.SHORT_SHA }} , |
62 | 53 | ${{ 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 |
65 | 56 |
|
66 | 57 | - name: Build and push ${{ env.image-fetcher }} |
67 | 58 | uses: docker/build-push-action@v3 |
|
74 | 65 | ${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-fetcher }}:latest , |
75 | 66 | ${{ secrets.AZURE_ACR_REGISTRY }}/${{ env.image-fetcher }}:${{ env.SHORT_SHA }} , |
76 | 67 | ${{ 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 |
79 | 70 |
|
80 | 71 | release: |
81 | 72 | name: Release to Azure Pipelines Production |
|
0 commit comments