Update docker/push/action.yaml

This commit is contained in:
Zakary Timson 2023-11-24 03:14:25 +00:00
parent 40a6a57e7e
commit 1180897353

View File

@ -1,32 +1,25 @@
name: Push docker image name: Docker Push
description: Push docker image to registry
inputs:
registry: inputs:
required: false registry:
type: string type: string
default: $GITHUB_SERVER_URL required: false
registry_user: default: ${{github.server_url}}
required: false name:
type: string type: string
default: $GITHUB_REPOSITORY_OWNER required: false
registry_pass: default: ${{github.repository}}
required: true tag:
type: string type: string
image: required: false
required: false default: ${{github.ref_name}}
type: string
default: $GITHUB_REPOSITORY runs:
tag: using: composite
required: false steps:
type: string - name: Docker Login
uses: docker://docker
runs: with:
using: composite entrypoint: docker
container: docker args: push "${{inputs.registry}}/${{inputs.name}}:${{inputs.tag}}"
steps:
- name: Push image
run: |
TAG=$([ -n "${{inputs.tag}}" ] && echo "${{inputs.tag}}" || [ "$GITHUB_REF" == "refs/heads/develop" ] && echo "latest" || echo "$GITHUB_REF_NAME" | sed -E "s/[_/]/-/g")
echo "${{inputs.registry_pass}}" | docker login -u "${{inputs.registry_user}}" --password-stdin "${{inputs.registry}}"
REG=$(echo "${{inputs.registry}}" | sed -E "s%https?://%%gi")
docker push "$REG/${{inputs.image}}:$TAG"