6161 id : cache_from
6262 env :
6363 GH_TOKEN : ${{ github.token }}
64+ REGISTRY : ${{ vars.ECR }}
6465 run : |
6566 LAST_PRS=$(gh api graphql \
6667 -F owner="NVIDIA-NeMo" \
7576 }
7677 }
7778 }' | jq -r '.data.repository.pullRequests.nodes[].number' | while read -r number; do
78- echo "type=registry,ref=${{ vars .ECR }}/${{ env.REPO_LOWER }}:$number-buildcache,mode=max"
79+ echo "type=registry,ref=${{ env .ECR }}/${{ env.REPO_LOWER }}:$number-buildcache,mode=max"
7980 done)
8081
8182 echo "LAST_PRS<<EOF" | tee -a $GITHUB_OUTPUT
8788
8889 - name : Build and push
8990 uses : docker/build-push-action@v5
91+ env :
92+ REGISTRY : ${{ vars.ECR }}
9093 with :
9194 file : ${{ inputs.dockerfile-path }}
9295 push : true
@@ -95,14 +98,14 @@ runs:
9598 BASE_IMAGE=pytorch
9699 INSTALL_TE=True
97100 cache-from : |
98- type=registry,ref=${{ vars.ECR }}/${{ env.REPO_LOWER }}:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}-buildcache,mode=max
99- type=registry,ref=${{ vars.ECR }}/${{ env.REPO_LOWER }}:main-buildcache,mode=max
101+ type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_LOWER }}:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}-buildcache,mode=max
102+ type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_LOWER }}:main-buildcache,mode=max
100103 ${{ steps.cache_from.outputs.LAST_PRS }}
101104 cache-to : |
102- type=registry,ref=${{ vars.ECR }}/${{ env.REPO_LOWER }}:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}-buildcache,mode=max
105+ type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_LOWER }}:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}-buildcache,mode=max
103106 no-cache : false
104107 tags : |
105- ${{ vars.ECR }}/${{ env.REPO_LOWER }}:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}
106- ${{ vars.ECR }}/${{ env.REPO_LOWER }}:${{ github.sha }}
108+ ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}
109+ ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}:${{ github.sha }}
107110 secrets : |
108111 GH_TOKEN=${{ inputs.PAT }}
0 commit comments