initial commit
This commit is contained in:
commit
b6ee3d56e7
39
action.yml
Normal file
39
action.yml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: 'Docker image' # TODO: rewrite to go
|
||||||
|
description: 'Make docker image'
|
||||||
|
inputs:
|
||||||
|
deployment_login:
|
||||||
|
description: 'Deployment login'
|
||||||
|
required: true
|
||||||
|
registry:
|
||||||
|
description: 'Registry'
|
||||||
|
required: true
|
||||||
|
image_name:
|
||||||
|
description: 'Image name'
|
||||||
|
required: true
|
||||||
|
aditional_args:
|
||||||
|
description: 'Docker build arguments'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
outputs:
|
||||||
|
image_version:
|
||||||
|
description: "Image version"
|
||||||
|
value: ${{ steps.git.outputs.short_hash }}
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- uses: https://github.com/actions/checkout.git@v4
|
||||||
|
- name: Login to ${{inputs.registry}}
|
||||||
|
uses: https://github.com/docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ inputs.deployment_login }}
|
||||||
|
password: ${{ inputs.deployment_login }}
|
||||||
|
registry: ${{inputs.registry}}
|
||||||
|
- name: Get short hash from git repository
|
||||||
|
id: git
|
||||||
|
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
|
||||||
|
shell: sh
|
||||||
|
- name: Build and push docker
|
||||||
|
run: |
|
||||||
|
docker build . -t ${{ inputs.image_name }}:${{ steps.git.outputs.short_hash }} ${{ inputs.aditional_args }} && \
|
||||||
|
docker push ${{ inputs.image_name }}:${{ steps.git.outputs.short_hash }}
|
||||||
|
shell: sh
|
Loading…
Reference in New Issue
Block a user