Skip to content

Commit

Permalink
Merge pull request #7 from bitovi/working-dir
Browse files Browse the repository at this point in the history
adding working-directory option
  • Loading branch information
PhillypHenning authored Sep 20, 2022
2 parents 37c02c0 + 7855b1f commit def3cb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The following can be used as `step.with` keys. T/F types expect true or false.
| `org_name` | string | No | Docker org name. | GitHub Org Name |
| `repo_name` | string | No | The name of the Docker Repository. | GitHub repo name. |
| `build_args` | string | No | Add arbitrary build arguments | N/A |
| `working-directory` | string | No | Specifies the working directory for the Docker Build step | N/A |


## Example 1
Expand Down Expand Up @@ -72,6 +73,7 @@ Here we check the code out since we make a change before the build / publish ste
org_name: bitovi
repo_name: deploy-eks-helm
build_args: --build-arg git_personal_token=PAT_token
working-directory: ./app/inner-folder
- run: |
echo "Image Created: ${{ env.image }}"
echo "Tag Created: ${{ env.tag }}"
Expand Down
7 changes: 7 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ inputs:
build_args:
description: Add a string of values to the end of the build command
required: false
working-directory:
description: Specify the working directory that the docker build will be run in
required: false

runs:
using: "composite"
Expand Down Expand Up @@ -89,6 +92,10 @@ runs:
IMAGE_NAME="$ORG_NAME/$REPO_NAME"
if [ -n "${{ inputs.working-directory }}" ]; then
cd ${{ inputs.working-directory }}
fi
echo "::group::Build Image"
echo "Building $IMAGE_NAME"
docker build --pull -t $IMAGE_NAME:$IMAGE_TAG . ${{ inputs.build_args }}
Expand Down

0 comments on commit def3cb9

Please sign in to comment.