diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index 4b33ffda7d2..a0be389d9c0 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -85,8 +85,8 @@ runs: username: ${{ github.actor }} password: ${{ github.token }} - - name: Build and Push - prebuilt and devel - if: ${{ (github.event_name == 'push' && github.ref_type == 'branch') || github.event_name == 'schedule' }} + - name: Build and Push to GitHub Container Registry + if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'registry') }} uses: docker/bake-action@v3 with: push: ${{ inputs.allow-push == 'true' }} @@ -94,101 +94,20 @@ runs: docker/docker-bake.hcl ${{ steps.meta-prebuilt.outputs.bake-file }} ${{ steps.meta-devel.outputs.bake-file }} - targets: | - prebuilt - devel - provenance: false - set: | - ${{ inputs.build-args }} - - - name: Build and Publish to GitHub Container Registry - if: ${{ ( github.event_name == 'push' && github.ref_type == 'tag' ) || ( github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'registry') }} - uses: docker/bake-action@v3 - with: - push: true - files: | - docker/docker-bake.hcl - ${{ steps.meta-devel.outputs.bake-file }} - ${{ steps.meta-prebuilt.outputs.bake-file }} ${{ steps.meta-runtime.outputs.bake-file }} provenance: false set: | ${{ inputs.build-args }} - - name: Build and Save Artifacts + - name: Build only uses: docker/bake-action@v3 with: push: false files: | docker/docker-bake.hcl - ${{ steps.meta-devel.outputs.bake-file }} ${{ steps.meta-prebuilt.outputs.bake-file }} + ${{ steps.meta-devel.outputs.bake-file }} ${{ steps.meta-runtime.outputs.bake-file }} provenance: false set: | ${{ inputs.build-args }} - prebuilt.output=type=docker,dest=/tmp/prebuilt.tar - devel.output=type=docker,dest=/tmp/devel.tar - runtime.output=type=docker,dest=/tmp/runtime.tar - - - name: Upload Artifact - prebuilt - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} - id: artifact-upload-step-prebuilt - uses: actions/upload-artifact@v4 - with: - name: prebuilt-image${{ inputs.tag-suffix }} - path: /tmp/prebuilt.tar - retention-days: 7 - compression-level: 6 - overwrite: true - if-no-files-found: error - - - name: Remove tar file - prebuilt - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} - run: | - rm /tmp/prebuilt.tar - shell: bash - - - name: Upload Artifact - devel - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} - id: artifact-upload-step-devel - uses: actions/upload-artifact@v4 - with: - name: devel-image${{ inputs.tag-suffix }} - path: /tmp/devel.tar - retention-days: 7 - compression-level: 6 - overwrite: true - if-no-files-found: error - - - name: Remove tar file - devel - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} - run: | - rm /tmp/devel.tar - shell: bash - - - name: Upload Artifact - runtime - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} - id: artifact-upload-step-runtime - uses: actions/upload-artifact@v4 - with: - name: runtime-image${{ inputs.tag-suffix }} - path: /tmp/runtime.tar - retention-days: 7 - compression-level: 6 - overwrite: true - if-no-files-found: error - - - name: Remove tar file - runtime - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} - run: | - rm /tmp/runtime.tar - shell: bash - - - name: Output artifact URLs - id: output-artifact-urls - run: | - echo 'prebuilt URL ${{ steps.artifact-upload-step-prebuilt.outputs.artifact-url }}' - echo 'devel URL ${{ steps.artifact-upload-step-devel.outputs.artifact-url }}' - echo 'runtime URL ${{ steps.artifact-upload-step-runtime.outputs.artifact-url }}' - shell: bash