Update docker/push/action.yaml
This commit is contained in:
parent
40a6a57e7e
commit
1180897353
@ -1,32 +1,25 @@
|
||||
name: Push docker image
|
||||
|
||||
inputs:
|
||||
registry:
|
||||
required: false
|
||||
type: string
|
||||
default: $GITHUB_SERVER_URL
|
||||
registry_user:
|
||||
required: false
|
||||
type: string
|
||||
default: $GITHUB_REPOSITORY_OWNER
|
||||
registry_pass:
|
||||
required: true
|
||||
type: string
|
||||
image:
|
||||
required: false
|
||||
type: string
|
||||
default: $GITHUB_REPOSITORY
|
||||
tag:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
container: docker
|
||||
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"
|
||||
name: Docker Push
|
||||
description: Push docker image to registry
|
||||
|
||||
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}}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Docker Login
|
||||
uses: docker://docker
|
||||
with:
|
||||
entrypoint: docker
|
||||
args: push "${{inputs.registry}}/${{inputs.name}}:${{inputs.tag}}"
|
||||
|
Loading…
Reference in New Issue
Block a user