From 40a6a57e7e5cd0eebd1d6326d33ddea82af989fa Mon Sep 17 00:00:00 2001 From: Zakary Timson Date: Fri, 24 Nov 2023 03:13:26 +0000 Subject: [PATCH] Update docker/build/action.yaml --- docker/build/action.yaml | 53 ++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/docker/build/action.yaml b/docker/build/action.yaml index 24c22c0..eb2311d 100644 --- a/docker/build/action.yaml +++ b/docker/build/action.yaml @@ -1,24 +1,29 @@ -name: Build docker image - -inputs: - registry: - required: false - type: string - default: $GITHUB_SERVER_URL - image: - required: true - type: string - default: $GITHUB_REPOSITORY - tag: - required: false - type: string - -runs: - using: composite - container: docker - steps: - - name: Build image - run: | - TAG=$([ -n "${{inputs.tag}}" ] && echo "${{inputs.tag}}" || [ "$GITHUB_REF" == "refs/heads/develop" ] && echo "latest" || echo "$GITHUB_REF_NAME" | sed -E "s/[_/]/-/g") - REG=$(echo "${{inputs.registry}}" | sed -E "s%https?://%%gi") - docker build --no-cache -t "$REG/${{inputs.image}}:$TAG" . +name: Docker Build +description: Build docker image + +inputs: + registry: + type: string + required: false + default: ${{github.server_url}} + name: + type: string + required: false + default: ${{github.repository}} + tag: + type: string + required: false + default: ${{github.ref_name}} + dockerfile: + type: string + required: false + default: Dockerfile + +runs: + using: composite + steps: + - name: Docker Login + uses: docker://docker + with: + entrypoint: docker + args: build -t "${{inputs.registry}}/${{inputs.name}}:${{inputs.tag}}" -f ${{inputs.dockerfile}} .