From 7095e41f615fb63ecc5445de4bc2a9bb78e7f6ff Mon Sep 17 00:00:00 2001 From: subochev Date: Sun, 3 Aug 2025 12:44:17 +0300 Subject: [PATCH] docker --- build-docker/action.yaml | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 build-docker/action.yaml diff --git a/build-docker/action.yaml b/build-docker/action.yaml new file mode 100644 index 0000000..fac05a0 --- /dev/null +++ b/build-docker/action.yaml @@ -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 }}