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