Skip to content

Commit

Permalink
add ability to specify a another Dockerfile (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
unixfox authored Aug 9, 2020
1 parent 8e52847 commit 62b7d15
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ jobs:
### Build
| parameter | description | required | default |
| --------- | --------------------------------- | -------- | -------------------- |
| registry | The registry to upload to. | false | gcr.io |
| image | The name of image to build. | false | `$GITHUB_REPOSITORY` |
| tag | The tag of the image. | false | `$GITHUB_SHA` |
| latest | If true, will also add latest tag | true | `true` |
| args | Additional args for docker | false | |
| parameter | description | required | default |
| --------- | --------------------------------- | -------- | -------------------- |
| registry | The registry to upload to. | false | gcr.io |
| image | The name of image to build. | false | `$GITHUB_REPOSITORY` |
| tag | The tag of the image. | false | `$GITHUB_SHA` |
| latest | If true, will also add latest tag | true | `true` |
| args | Additional args for docker | false | |
| dockerfile | The Dockerfile to use | false | Dockerfile |

### Push

Expand Down
4 changes: 4 additions & 0 deletions build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
description: the context path
required: true
default: "."
dockerfile:
description: the Dockerfile to use
required: false
default: "Dockerfile"

runs:
using: 'docker'
Expand Down
3 changes: 2 additions & 1 deletion build/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ set -e
: ${INPUT_TAG:=$GITHUB_SHA}
: ${INPUT_LATEST:=true}
: ${INPUT_PATH:=.}
: ${INPUT_DOCKERFILE:=Dockerfile}


docker build $INPUT_ARGS -t $INPUT_IMAGE:$INPUT_TAG $INPUT_PATH
docker build $INPUT_ARGS -f $INPUT_DOCKERFILE -t $INPUT_IMAGE:$INPUT_TAG $INPUT_PATH
docker tag $INPUT_IMAGE:$INPUT_TAG $INPUT_REGISTRY/$INPUT_IMAGE:$INPUT_TAG

if [ $INPUT_LATEST = true ]; then
Expand Down

0 comments on commit 62b7d15

Please sign in to comment.