75 lines
1.9 KiB
YAML
75 lines
1.9 KiB
YAML
name: docker-build-push
|
|
description: Clone app repo, build Docker image, and push it to the private registry
|
|
|
|
inputs:
|
|
git_server_url:
|
|
description: Full Git server URL, for example https://git.example.com
|
|
required: true
|
|
|
|
git_repository:
|
|
description: Repository path, for example example/testapp
|
|
required: true
|
|
|
|
git_sha:
|
|
description: Commit SHA to check out
|
|
required: true
|
|
|
|
git_user:
|
|
description: Git username for cloning private repositories
|
|
required: true
|
|
|
|
git_token:
|
|
description: Git token for cloning private repositories
|
|
required: true
|
|
|
|
registry:
|
|
description: OCI registry host
|
|
required: false
|
|
default: zmeyka.exocortex.ru
|
|
|
|
registry_user:
|
|
description: Registry username
|
|
required: true
|
|
|
|
registry_token:
|
|
description: Registry token or password
|
|
required: true
|
|
|
|
image_name:
|
|
description: Image path inside registry, for example example/testapp
|
|
required: true
|
|
|
|
image_tag:
|
|
description: Image tag, for example latest
|
|
required: true
|
|
|
|
context:
|
|
description: Docker build context
|
|
required: false
|
|
default: .
|
|
|
|
dockerfile:
|
|
description: Dockerfile path
|
|
required: false
|
|
default: Dockerfile
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Run build and push script
|
|
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
|