Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ on:
build-secrets:
description: "The Docker secrets to use for the build"
required: false
LICENSE:
description: "The licence file to bundle into the ECR image"
required: false

jobs:
setup:
Expand Down Expand Up @@ -112,7 +109,6 @@ jobs:
aws-key-id: ${{ secrets.aws-key-id }}
aws-secret-key: ${{ secrets.aws-secret-key }}
build-secrets: ${{ secrets.build-secrets }}
license: ${{ secrets.LICENSE }}

deploy-staging:
uses: ./.github/workflows/lambda_deploy.yml
Expand Down
38 changes: 1 addition & 37 deletions .github/workflows/lambda_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,11 @@ on:
build-secrets:
description: "The Docker secrets to use for the build"
required: false
LICENSE:
description: "The licence file to bundle into the ECR image"
required: false
outputs:
registry:
description: "The registry where the image was pushed"
value: ${{ jobs.build.outputs.registry }}


jobs:
build:
name: Build (${{ inputs.environment }})
Expand All @@ -72,8 +68,6 @@ jobs:
id-token: write
outputs:
registry: ${{ steps.login-ecr.outputs.registry }}
env:
LICENSE: ${{ secrets.LICENSE }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -112,37 +106,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Write license file if secret exists
run: |
if [ -n "${{ secrets.LICENSE }}" ]; then
mkdir ./dist/
echo "${{ secrets.LICENSE }}" > ./dist/LICENSE.txt
echo "License file created at ./dist/LICENSE.txt"
ls ./dist
else
echo "LICENSE_TEXT secret not provided. Skipping license file creation."
fi


- name: Build and push with licence
if: ${{ env.LICENSE != '' }}
uses: docker/build-push-action@v6
with:
file: ${{ inputs.build-file || 'Dockerfile' }}
context: ${{ inputs.build-context || '.'}}
target: with-license
push: ${{ inputs.build-push }}
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max,ignore-error=true
platforms: ${{ inputs.build-platforms }}
build-args: ${{ inputs.build-args }}
secrets: ${{ secrets.build-secrets }}

- name: Build and push without licence
if: ${{ env.LICENSE != '' }}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: ${{ inputs.build-file || 'Dockerfile' }}
Expand Down