From d05baa7f96cba43dfde9fea9de866e880cced3d1 Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Tue, 17 Sep 2024 15:03:29 -0400 Subject: [PATCH] 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 }}