Skip to content

feat: expose build-args input for Docker builds - #544

Open
MykhailoRyzhman wants to merge 1 commit into
mainfrom
feat/docker-build-args
Open

MykhailoRyzhman wants to merge 1 commit into
mainfrom
feat/docker-build-args

Conversation

@MykhailoRyzhman

Copy link
Copy Markdown
Contributor

Applicable issues

  • fixes #

Description of changes

Add optional build-args input to build_docker and expose it across reusable workflows that build Docker images.

Consumer Dockerfiles may declare ARG values that must be supplied at build time, but build_docker currently does not forward them to docker/build-push-action.

This change adds build-args to:

  • actions/build_docker/action.yml — forwarded to both docker/build-push-action steps (Trivy scan build and push build) so the scanned and published images match
  • generic_docker_pr.yml, generic_docker_release.yml
  • python_docker_pr.yml, python_docker_release.yml
  • java_pr.yml, java_release.yml
  • node_pr.yml, node_release.yml

The input format matches docker/build-push-action build-args: a newline-separated list of KEY=VALUE pairs. Default is empty (no build arguments).

Example for a reusable workflow consumer:

jobs:
  release:
    uses: epam/ai-dial-ci/.github/workflows/python_docker_release.yml@<version>
    with:
      build-args: |
        GIT_COMMIT=${{ github.sha }}
    secrets: inherit

Example for a custom workflow that calls build_docker directly:

- uses: epam/ai-dial-ci/actions/build_docker@<version>
  with:
    image-names: ghcr.io/${{ github.repository }}
    image-tags: development
    dockerfile-path: docker/Dockerfile
    build-args: |
      GIT_COMMIT=${{ github.sha }}

Checklist

  • custom check

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant