From e9d1cfe6a21d3ef118a821f7d1bb0f922ff4a5d4 Mon Sep 17 00:00:00 2001 From: leehk Date: Tue, 15 Apr 2025 16:25:03 +0800 Subject: [PATCH] update --- .github/workflows/template_build.yml | 45 ++-------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/.github/workflows/template_build.yml b/.github/workflows/template_build.yml index d2d36ea..7034911 100644 --- a/.github/workflows/template_build.yml +++ b/.github/workflows/template_build.yml @@ -91,39 +91,7 @@ jobs: echo "Attempting to pull intermediate image for cache: ${{ steps.tags.outputs.image_repo_path }}:${{ inputs.intermediate_container }}" docker pull ${{ steps.tags.outputs.image_repo_path }}:${{ inputs.intermediate_container }} || true - - name: Build Intermediate Image - # Builds the intermediate target if specified - if: inputs.intermediate_container != '' - run: | - echo "Building intermediate image: ${{ steps.tags.outputs.image_repo_path }}:${{ inputs.intermediate_container }}" - docker build \ - -f ${{ inputs.dockerfile }} \ - --pull \ - --cache-from type=registry,ref=${{ steps.tags.outputs.image_repo_path }}:${{ inputs.intermediate_container }} \ - -t ${{ steps.tags.outputs.image_repo_path }}:${{ inputs.intermediate_container }} \ - --target ${{ inputs.intermediate_container }} \ - ${{ inputs.args }} \ - ${{ inputs.build_context }} - - - name: Build Final Image (with Intermediate Cache) - # Builds the final image using intermediate cache if specified - if: inputs.intermediate_container != '' - run: | - echo "Building final image with intermediate cache..." - docker build \ - -f ${{ inputs.dockerfile }} \ - --pull \ - --cache-from type=registry,ref=${{ steps.tags.outputs.image_repo_path }}:latest \ - --cache-from type=registry,ref=${{ steps.tags.outputs.image_repo_path }}:${{ inputs.intermediate_container }} \ - -t ${{ steps.tags.outputs.image_repo_path }}:${{ steps.tags.outputs.tag_build_id }} \ - -t ${{ steps.tags.outputs.image_repo_path }}:${{ steps.tags.outputs.tag_commit_sha }} \ - -t ${{ steps.tags.outputs.image_repo_path }}:latest \ - ${{ inputs.args }} \ - ${{ inputs.build_context }} - - - name: Build Final Image (without Intermediate Cache) - # Builds the final image without intermediate cache if not specified - if: inputs.intermediate_container == '' + - name: Build Final Image run: | echo "Building final image without intermediate cache..." docker build \ @@ -140,13 +108,6 @@ jobs: # Pushes the final tags (build id, commit sha, latest) run: | echo "Pushing final image tags..." - # docker push ${{ steps.tags.outputs.image_repo_path }}:${{ steps.tags.outputs.tag_build_id }} - # docker push ${{ steps.tags.outputs.image_repo_path }}:${{ steps.tags.outputs.tag_commit_sha }} + docker push ${{ steps.tags.outputs.image_repo_path }}:${{ steps.tags.outputs.tag_build_id }} + docker push ${{ steps.tags.outputs.image_repo_path }}:${{ steps.tags.outputs.tag_commit_sha }} docker push ${{ steps.tags.outputs.image_repo_path }}:latest - - - name: Push Intermediate Image - # Pushes the intermediate tag if it was built - if: inputs.intermediate_container != '' - run: | - echo "Pushing intermediate image tag..." - docker push ${{ steps.tags.outputs.image_repo_path }}:${{ inputs.intermediate_container }} \ No newline at end of file