Skip to content

Commit 9c840fb

Browse files
authored
variable dockerfile and context (#13)
add `file` and `context` inputs to docker-publish workflow
1 parent ea57e13 commit 9c840fb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/docker-publish.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ on:
2020
description: 'Determines if the resulting Docker image is pushed to Docker Hub'
2121
required: true
2222
type: boolean
23+
context:
24+
description: 'Docker build context'
25+
required: false
26+
default: '.'
27+
type: string
28+
file:
29+
description: 'Path to Dockerfile, e.g. "./Dockerfile"'
30+
required: false
31+
default: './Dockerfile'
32+
type: string
2333

2434
jobs:
2535
build:
@@ -67,9 +77,9 @@ jobs:
6777
name: Build and push Docker image
6878
uses: docker/build-push-action@v6
6979
with:
70-
context: .
80+
context: ${{ inputs.context }}
7181
# https://docs.docker.com/build/concepts/dockerfile/#filename
72-
file: ./Dockerfile
82+
file: ${{ inputs.file }}
7383
platforms: linux/amd64,linux/arm64
7484
push: ${{ inputs.push }}
7585
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)