This commit is contained in:
subochev 2025-08-03 12:44:17 +03:00
parent f8314d3f31
commit 7095e41f61

42
build-docker/action.yaml Normal file
View File

@ -0,0 +1,42 @@
name: "Build and push docker image"
description: "Run podman build and push to regestry"
inputs:
image_name: # id of input
description: "Name of image"
required: true
tags: # id of input
description: "Tags of image"
required: true
context:
description: "Docker directory location"
default: "."
# outputs:
# random-number:
# description: "Random number"
# value: ${{ steps.random-number-generator.outputs.random-number }}
runs:
using: "composite"
steps:
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
env:
RUNNER_OS: Linux
with:
image: ${{ inputs.image_name }}
tags: ${{ inputs.tags }}
containerfiles: |
${{ inputs.context }}/Dockerfile
oci: true
tls-verify: false
context: ${{ inputs.context }}
- name: Push To Repository
id: push-to-repository
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ inputs.image_name }}
tags: ${{ inputs.tags }}
registry: ${{ vars.DOCKER_REGISTRY_HOST }}
username: ${{ vars.DOCKER_REGISTRY_USERNAME }}
password: ${{ vars.DOCKER_REGISTRY_PASSWORD }}