Skip to content
Draft
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ author: "Devito"

inputs:
# The only supported GHA input type is string
working-directory:
description: "Change to this directory before executing build"
required: true
default: "."
file:
description: "Dockerfile containing build instructions"
required: true
Expand All @@ -18,6 +22,10 @@ inputs:
description: "Arguments to pass to `docker build`"
required: true
default: ""
local:
description: "Set true to prevent attempting to pull the image"
required: true
default: ""

outputs:
unique:
Expand All @@ -40,9 +48,11 @@ runs:
shell: bash
env:
BASE: ${{ inputs.base }}
LOCAL: ${{ inputs.local }}
run: |
cd ${{ inputs.working-directory }}
docker build \
--pull \
$([ "${{ inputs.local }}" = true ] && echo "" || echo "--pull") \
--file ${{ inputs.file }} \
--tag ${{ inputs.tag }}_${{ steps.uniquetag.outputs.unique }} \
${BASE:+--build-arg base=$BASE} \
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/docker-run/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ author: "Devito"

inputs:
# The only supported GHA input type is string
working-directory:
description: "Change to this directory before executing build"
required: true
default: "."
uid:
description: "Unique identifier output from docker-build action"
required: true
Expand Down Expand Up @@ -51,6 +55,7 @@ runs:
env:
NAME: ${{ inputs.name }}
run: |
cd ${{ inputs.working-directory }}
docker run \
--init -t --rm \
${{ inputs.args }} \
Expand Down
Loading