From d05baa7f96cba43dfde9fea9de866e880cced3d1 Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Tue, 17 Sep 2024 15:03:29 -0400 Subject: [PATCH 1/2] Issue #154: adds platform compatibility and optional variable for providing path to dockerfile. Useful for devops repo --- .../workflow-build-push-container-github-registry.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow-build-push-container-github-registry.yml b/.github/workflows/workflow-build-push-container-github-registry.yml index ef4fa31..0ca20b9 100644 --- a/.github/workflows/workflow-build-push-container-github-registry.yml +++ b/.github/workflows/workflow-build-push-container-github-registry.yml @@ -13,6 +13,9 @@ on: registry: required: true type: string + dockerfile-folder-path: + required: false + type: string jobs: build-push-image: @@ -53,8 +56,9 @@ jobs: if: github.event.pull_request.merged == false uses: docker/build-push-action@v5 with: - context: . + context: ${{ inputs.dockerfile-folder-path || '.' }} push: true + platforms: linux/amd64,linux/arm64 tags: | ${{ inputs.registry }}/${{ inputs.container-name }}:${{ github.event.number }} ${{ inputs.registry }}/${{ inputs.container-name }}:${{ inputs.tag }} @@ -67,8 +71,9 @@ jobs: if: github.event.pull_request.merged == true uses: docker/build-push-action@v5 with: - context: . + context: ${{ inputs.dockerfile-folder-path || '.' }} push: true + platforms: linux/amd64,linux/arm64 tags: | ${{ inputs.registry }}/${{ inputs.container-name }}:${{ inputs.tag }} ${{ inputs.registry }}/${{ inputs.container-name }}:${{ github.event.pull_request.base.ref }} From 72683b2d3453671c444aefe6cc5f926f0dc21ada Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Tue, 17 Sep 2024 15:15:01 -0400 Subject: [PATCH 2/2] Issue #154 : adds fix for workflow dispatch caller --- .../workflow-build-push-container-github-registry.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow-build-push-container-github-registry.yml b/.github/workflows/workflow-build-push-container-github-registry.yml index 0ca20b9..0595263 100644 --- a/.github/workflows/workflow-build-push-container-github-registry.yml +++ b/.github/workflows/workflow-build-push-container-github-registry.yml @@ -60,9 +60,9 @@ jobs: push: true platforms: linux/amd64,linux/arm64 tags: | - ${{ inputs.registry }}/${{ inputs.container-name }}:${{ github.event.number }} + ${{ inputs.registry }}/${{ inputs.container-name }}:${{ github.event.number || github.run_number }} ${{ inputs.registry }}/${{ inputs.container-name }}:${{ inputs.tag }} - ${{ inputs.registry }}/${{ inputs.container-name }}:${{ steps.extract_branch_name.outputs.clean_branch_name }} + ${{ inputs.registry }}/${{ inputs.container-name }}:${{ steps.extract_branch_name.outputs.clean_branch_name || 'latest' }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new