Skip to content

Commit

Permalink
Allow passing arbitrary argument to docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
inchuev committed Apr 26, 2024
1 parent 283f6f4 commit 57d9f01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ on:
type: string
default: ''
description: 'Dockerfile target'
docker_build_args:
required: false
type: string
default: ''
description: 'Additional docker build args'

secrets:
API_TOKEN_GITHUB:
Expand All @@ -49,7 +54,7 @@ jobs:
token: ${{ secrets.API_TOKEN_GITHUB }}

- name: Docker | Build and Push
uses: timescale/cloud-actions/build-push@main
uses: timescale/cloud-actions/build-push@allow-git-ssh
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -59,3 +64,4 @@ jobs:
registry: ${{ inputs.registry }}
target: ${{ inputs.docker_target }}
file: ${{ inputs.dockerfile_path }}
docker-build-args: ${{ inputs.docker_build_args }}
5 changes: 4 additions & 1 deletion build-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
tags:
description: 'List of tags'
required: true
docker-build-args:
description: 'Additional argument to pass to docker build'
required: false

runs:
using: "composite"
Expand All @@ -40,7 +43,7 @@ runs:

- name: Docker Deps
run: |
docker build -t ${{ inputs.registry }}:deps -f ${{ inputs.file }} .
docker build ${{ inputs.docker_build_args }} -t ${{ inputs.registry }}:deps -f ${{ inputs.file }} .
shell: bash

- name: Docker Build
Expand Down

0 comments on commit 57d9f01

Please sign in to comment.