Split workflow into steps

This commit is contained in:
SG
2026-03-31 13:58:43 +03:00
parent 47b76306b2
commit b765564844
3 changed files with 121 additions and 14 deletions

View File

@@ -53,22 +53,53 @@ inputs:
required: false
default: Dockerfile
remote_docker_ssh_host:
description: Remote Docker host to pull and run the image on
required: false
remote_docker_ssh_port:
description: SSH port on the remote Docker host
required: false
default: "22"
remote_docker_ssh_username:
description: Remote Docker host SSH user
required: false
remote_docker_ssh_key:
decription: Private SSH key to update the image on remote Docker host
required: false
runs:
using: composite
steps:
- name: Run build and push script
- name: Build the image
shell: bash
env:
INPUT_GIT_SERVER_URL: ${{ inputs.git_server_url }}
INPUT_GIT_REPOSITORY: ${{ inputs.git_repository }}
INPUT_GIT_SHA: ${{ inputs.git_sha }}
INPUT_GIT_USER: ${{ inputs.git_user }}
INPUT_GIT_TOKEN: ${{ inputs.git_token }}
INPUT_REGISTRY: ${{ inputs.registry }}
INPUT_REGISTRY_USER: ${{ inputs.registry_user }}
INPUT_REGISTRY_TOKEN: ${{ inputs.registry_token }}
INPUT_IMAGE_NAME: ${{ inputs.image_name }}
INPUT_IMAGE_TAG: ${{ inputs.image_tag }}
INPUT_CONTEXT: ${{ inputs.context }}
INPUT_DOCKERFILE: ${{ inputs.dockerfile }}
run: ${{ gitea.action_path }}/build.sh
- name: Push to registry
shell: bash
run: ${{ gitea.action_path }}/push.sh
- name: Update remote Docker host
shell: bash
run: ${{ gitea.action_path }}/update.sh
env:
INPUT_GIT_SERVER_URL: ${{ inputs.git_server_url }}
INPUT_GIT_REPOSITORY: ${{ inputs.git_repository }}
INPUT_GIT_SHA: ${{ inputs.git_sha }}
INPUT_GIT_USER: ${{ inputs.git_user }}
INPUT_GIT_TOKEN: ${{ inputs.git_token }}
INPUT_REGISTRY: ${{ inputs.registry }}
INPUT_REGISTRY_USER: ${{ inputs.registry_user }}
INPUT_REGISTRY_TOKEN: ${{ inputs.registry_token }}
INPUT_IMAGE_NAME: ${{ inputs.image_name }}
INPUT_IMAGE_TAG: ${{ inputs.image_tag }}
INPUT_CONTEXT: ${{ inputs.context }}
INPUT_DOCKERFILE: ${{ inputs.dockerfile }}
INPUT_REMOTE_DOCKER_SSH_HOST: ${{ inputs.remote_docker_ssh_host }}
INPUT_REMOTE_DOCKER_SSH_PORT: ${{ inputs.remote_docker_ssh_port }}
INPUT_REMOTE_DOCKER_SSH_USERNAME: ${{ inputs.remote_docker_ssh_username }}
INPUT_REMOTE_DOCKER_SSH_KEY: ${{ inputs.remote_docker_ssh_key }}