2023-07-28 13:58:51 -04:00
|
|
|
name: Push docker image
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
registry:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: $GITHUB_SERVER_URL
|
|
|
|
registry_user:
|
|
|
|
required: false
|
|
|
|
type: string
|
2023-08-02 10:14:37 -04:00
|
|
|
default: $GITHUB_REPOSITORY_OWNER
|
2023-07-28 13:58:51 -04:00
|
|
|
registry_pass:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
image:
|
2023-08-02 10:14:37 -04:00
|
|
|
required: false
|
2023-07-28 13:58:51 -04:00
|
|
|
type: string
|
|
|
|
default: $GITHUB_REPOSITORY
|
|
|
|
tag:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
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}}"
|
2023-07-28 15:12:58 -04:00
|
|
|
REG=$(echo "${{inputs.registry}}" | sed -E "s%https?://%%gi")
|
|
|
|
docker push "$REG/${{inputs.image}}:$TAG"
|