Update docker/push/action.yaml

This commit is contained in:
Zakary Timson 2024-02-06 13:51:33 +00:00
parent 723a0f67dd
commit c1fa83d47c

View File

@ -1,38 +1,48 @@
name: Docker Push name: Docker Push
description: Push Image to Registry description: Push Image to Registry
inputs: inputs:
registry: registry:
type: string type: string
required: false required: false
description: Docker registry FQDN description: Docker registry FQDN
default: ${{github.server_url}} default: ${{github.server_url}}
user: user:
type: string type: string
required: false required: false
description: Docker user description: Docker user
default: ${{github.repository_owner}} default: ${{github.repository_owner}}
pass: pass:
type: string type: string
required: false required: false
description: User password description: User password
default: ${{secrets.DEPLOY_TOKEN}} default: ${{secrets.DEPLOY_TOKEN}}
name: name:
type: string type: string
required: false required: false
default: ${{github.repository}} default: ${{github.repository}}
tag: tag:
type: string type: string
required: false required: false
default: ${{github.ref_name}} default: ${{github.ref_name}}
from:
runs: type: string
using: composite required: false
steps: description: Re-tag an existing image
- name: Format Registry URL default:
run: echo "URL=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% )" >> $GITHUB_ENV
shell: sh runs:
- name: Docker Login using: composite
uses: docker://docker steps:
with: - name: Format Registry URL
args: /bin/sh -c "docker login -u ${{inputs.user}} -p ${{inputs.pass}} ${{env.URL}} && docker push ${{env.URL}}/${{inputs.name}}:${{inputs.tag}}" run: echo "URL=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% )" >> $GITHUB_ENV
shell: sh
- name: Re-Tag
run: [ -n ${{inputs.from}} ] && docker tag ${{inputs.from}} "${{env.URL}}/${{inputs.name}}:${{inputs.tag}}"
shell: sh
- name: Docker Login
uses: docker://docker
with:
args: /bin/sh -c "docker login -u ${{inputs.user}} -p ${{inputs.pass}} ${{env.URL}} && docker push ${{env.URL}}/${{inputs.name}}:${{inputs.tag}}"