Skip to content
Open
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
29 changes: 29 additions & 0 deletions .github/actions/get-docker-image-path/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Detect Dockerfile location'
description: 'Decides which location the docker file is located at'
inputs:
default-directory:
description: 'Module name for Gradle build'
required: false
dockerfile-path:
description: 'An option to override the default dockerfile location, if none supplied the return value would be ${{ inputs.default-directory}}/Dockerfile'
required: false
outputs:
location:
description: the location of the dockerfile that should be used
value: ${{ steps.dockerfile.outputs.location }}

runs:
using: 'composite'
steps:
- name: Find Dockerfile Location
id: dockerfile
shell: bash
run: |
if [ -n "${{ inputs.dockerfile-path }}" ]; then
echo "location=${{ inputs.dockerfile-path }}" >> $GITHUB_OUTPUT
elif [-n "${{ inputs.default-directory }}"]; then
echo "location=${{ inputs.default-directory }}/Dockerfile" >> $GITHUB_OUTPUT
else
echo "Both dockerfile-path and default-directory are empty"
exit 1
fi
12 changes: 12 additions & 0 deletions .github/workflows/ci-composite-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ jobs:
uses: yonatankarp/github-actions/.github/actions/build-jar-artifact@main
with:
tag: "test-tag"

- name: "[test] - Get Dockrfile for module - use dockerfile override"
uses: yonatankarp/github-actions/.github/actions/get-docker-image-path@extract-dockerfile-location
# with:
# module-name: ""
# dockerfile-path: "dockerfile-location"
#
# - name: "[test] Get Dockrfile for module - fallback to module"
# uses: yonatankarp/github-actions/.github/actions/get-docker-image-path@extract-dockerfile-location
# with:
# module-name: "test-tag"
# dockerfile-path: ""