Skip to content

Commit

Permalink
feat: make context for Docker build configurable
Browse files Browse the repository at this point in the history
...for Dockerfile workflows.
  • Loading branch information
stempler committed Nov 20, 2023
1 parent 9b93e03 commit 85ac57e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/dockerfile-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
description: Image tag to build
required: true
type: string
context:
description: Docker build context
type: string
default: .
secrets:
DOCKER_HUB_USERNAME:
DOCKER_HUB_PASSWORD:
Expand All @@ -19,6 +23,7 @@ jobs:
with:
image: ${{ inputs.image }}
tag: ${{ inputs.tag }}
context: ${{ inputs.context }}
push: false
notify-failure: false
secrets: inherit
5 changes: 5 additions & 0 deletions .github/workflows/dockerfile-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
description: Image tag to build
required: true
type: string
context:
description: Docker build context
type: string
default: .
secrets:
DOCKER_HUB_USERNAME:
required: true
Expand All @@ -23,6 +27,7 @@ jobs:
with:
image: ${{ inputs.image }}
tag: ${{ inputs.tag }}
context: ${{ inputs.context }}
push: true
notify-failure: true
secrets: inherit
6 changes: 5 additions & 1 deletion .github/workflows/dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
description: If the image should be pushed
type: boolean
default: false
context:
description: Docker build context
type: string
default: .
secrets:
DOCKER_HUB_USERNAME:
DOCKER_HUB_PASSWORD:
Expand Down Expand Up @@ -46,7 +50,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
context: ${{ inputs.context }}
push: ${{ inputs.push }}
tags: "${{ inputs.image }}:${{ inputs.tag }}"
labels: ${{ steps.meta.outputs.labels }}
Expand Down

0 comments on commit 85ac57e

Please sign in to comment.