Skip to content

Commit 0f054d0

Browse files
authored
Merge pull request #4 from lambda-feedback/feature/licence
Updated workflow to build using target if licence is present
2 parents 33c6e64 + 203d255 commit 0f054d0

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/lambda_build.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,31 @@ jobs:
115115
if [ -n "${{ secrets.LICENSE }}" ]; then
116116
echo "${{ secrets.LICENSE }}" > dist/LICENSE.txt
117117
echo "License file created at dist/LICENSE.txt"
118+
echo "target=with-licence" >> $GITHUB_OUTPUT
118119
else
119120
echo "LICENSE_TEXT secret not provided. Skipping license file creation."
120121
fi
121122
122123
123-
- name: Build and push
124+
- name: Build and push with licence
125+
if: ${{ secrets.LICENSE != '' }}
126+
uses: docker/build-push-action@v6
127+
with:
128+
file: ${{ inputs.build-file || 'Dockerfile' }}
129+
context: ${{ inputs.build-context || '.'}}
130+
target: ${{ steps.license.outputs.target }}
131+
push: ${{ inputs.build-push }}
132+
provenance: false
133+
tags: ${{ steps.meta.outputs.tags }}
134+
labels: ${{ steps.meta.outputs.labels }}
135+
cache-from: type=gha
136+
cache-to: type=gha,mode=max,ignore-error=true
137+
platforms: ${{ inputs.build-platforms }}
138+
build-args: ${{ inputs.build-args }}
139+
secrets: ${{ secrets.build-secrets }}
140+
141+
- name: Build and push without licence
142+
if: ${{ secrets.LICENSE != '' }}
124143
uses: docker/build-push-action@v6
125144
with:
126145
file: ${{ inputs.build-file || 'Dockerfile' }}

0 commit comments

Comments
 (0)