39 lines
1001 B
YAML
39 lines
1001 B
YAML
name: Docker Push
|
|
description: Push docker image to registry
|
|
|
|
inputs:
|
|
registry:
|
|
type: string
|
|
required: false
|
|
default: ${{github.server_url}}
|
|
user:
|
|
type: string
|
|
required: false
|
|
description: Docker user
|
|
default: ${{github.repository_owner}}
|
|
pass:
|
|
type: string
|
|
required: false
|
|
description: User password
|
|
default: ${{secrets.DEPLOY_TOKEN}}
|
|
name:
|
|
type: string
|
|
required: false
|
|
default: ${{github.repository}}
|
|
tag:
|
|
type: string
|
|
required: false
|
|
default: ${{github.ref_name}}
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Creat Image Tag
|
|
run: echo "URL=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% )" >> $GITHUB_ENV
|
|
shell: sh
|
|
- name: Docker Push
|
|
uses: docker://docker
|
|
with:
|
|
entrypoint: docker
|
|
args: login -u "${{inputs.user}}" -p "${{inputs.pass}}" "${{env.URL}}" && docker push "${{env.URL}}/${{inputs.name}}:${{inputs.tag}}"
|