50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
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: Print Image Name
|
|
shell: bash
|
|
run: >-
|
|
echo '------------------------';
|
|
echo 'ImageName: ${{ vars.DOCKER_REGISTRY_HOST }}/${{ inputs.image_name }}:${{ inputs.tags }}';
|
|
echo '------------------------';
|
|
|
|
- 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 }}
|