Skip to content

Commit d1dbeeb

Browse files
committed
allow adjusting build dirs
1 parent e5a4ae3 commit d1dbeeb

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ on:
77
type: string
88
description: "The name of the repository where the template is located"
99
required: true
10+
build-file:
11+
type: string
12+
description: "The path to the Dockerfile to build"
13+
required: false
14+
default: "Dockerfile"
15+
build-context:
16+
type: string
17+
description: "The context to use for the Docker build"
18+
required: false
19+
default: "."
1020
build-target:
1121
type: string
1222
description: "The target stage of the image to build"
@@ -75,7 +85,8 @@ jobs:
7585
- name: Build and push
7686
uses: docker/build-push-action@v4
7787
with:
78-
context: .
88+
file: ${{ inputs.build-file || 'Dockerfile' }}
89+
context: ${{ inputs.build-context || '.'}}
7990
target: ${{ inputs.build-target }}
8091
push: ${{ (github.event_name == 'push' && (github.ref_name == github.event.repository.default_branch || github.ref_type == 'tag')) || github.event_name == 'pull_request' }}
8192
platforms: ${{ inputs.build-arm && github.ref_name == github.event.repository.default_branch && 'linux/amd64,linux/arm64' || 'linux/amd64' }}

.github/workflows/deploy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ on:
1212
type: string
1313
description: "The name of the repository where the template is located"
1414
required: true
15+
build-file:
16+
type: string
17+
description: "The path to the Dockerfile to build"
18+
required: false
19+
default: "Dockerfile"
20+
build-context:
21+
type: string
22+
description: "The context to use for the Docker build"
23+
required: false
24+
default: "."
1525
build-target:
1626
type: string
1727
description: "The target stage of the image to build"
@@ -80,6 +90,8 @@ jobs:
8090
environment: ${{ matrix.environment }}
8191
function-name: ${{ needs.setup.outputs.evaluation_function_name }}
8292
region: ${{ inputs.region }}
93+
build-file: ${{ inputs.build-file }}
94+
build-context: ${{ inputs.build-context }}
8395
build-target: ${{ inputs.build-target }}
8496
build-args: ${{ inputs.build-args }}
8597
secrets:

.github/workflows/lambda_build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ on:
1616
type: string
1717
description: "The name of the Lambda function to deploy"
1818
required: true
19+
build-file:
20+
type: string
21+
description: "The path to the Dockerfile to build"
22+
required: false
23+
default: "Dockerfile"
24+
build-context:
25+
type: string
26+
description: "The context to use for the Docker build"
27+
required: false
28+
default: "."
1929
build-target:
2030
type: string
2131
description: "The target stage of the image to build"
@@ -90,7 +100,8 @@ jobs:
90100
- name: Build and push
91101
uses: docker/build-push-action@v4
92102
with:
93-
context: .
103+
file: ${{ inputs.build-file || 'Dockerfile' }}
104+
context: ${{ inputs.build-context || '.'}}
94105
target: ${{ inputs.build-target }}
95106
push: true
96107
provenance: false

0 commit comments

Comments
 (0)