Skip to content

Allow building Docker image via script #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/docker-build-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
default: true
required: false
type: boolean
docker_build_script:
description: "Script that produces a Docker image"
required: false
type: string
provenance:
description: "Generate provenance attestation for the build"
default: true
Expand Down Expand Up @@ -95,8 +99,12 @@ jobs:
username: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}

- name: Build Docker image via build script
if: ${{ inputs.docker_build_script && steps.dockerfile-exists.outputs.result == 'true' && (inputs.docker_hub || inputs.aws_ecr)}}
run: ${{ inputs.docker_build_script }}

- name: Build Docker image
if: ${{steps.dockerfile-exists.outputs.result == 'true' && (inputs.docker_hub || inputs.aws_ecr)}}
if: ${{ !inputs.docker_build_script && steps.dockerfile-exists.outputs.result == 'true' && (inputs.docker_hub || inputs.aws_ecr)}}
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
with:
context: .
Expand Down