Skip to content

Commit 963426b

Browse files
committed
eli-606 switching to just use the lambda we built initially
1 parent 67e470c commit 963426b

1 file changed

Lines changed: 34 additions & 49 deletions

File tree

.github/workflows/release-candidate.yml

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,25 @@ jobs:
124124
echo "exists=false" >> $GITHUB_OUTPUT
125125
fi
126126
127+
- name: "Download artifact for workflow reuse"
128+
if: steps.check.outputs.exists == 'true'
129+
run: |
130+
TAG="${{ needs.validate.outputs.dev_tag }}"
131+
BUCKET="${{ steps.bucket.outputs.name }}"
132+
mkdir -p ./dist
133+
aws s3 cp \
134+
"s3://$BUCKET/artifacts/$TAG/lambda.zip" \
135+
./dist/lambda.zip \
136+
--region eu-west-2
137+
138+
- name: "Upload lambda artifact"
139+
if: steps.check.outputs.exists == 'true'
140+
uses: actions/upload-artifact@v4
141+
with:
142+
name: lambda-${{ needs.validate.outputs.dev_tag }}
143+
path: dist/lambda.zip
144+
if-no-files-found: error
145+
127146
rebuild-artifact:
128147
name: "Rebuild and upload artifact (if missing)"
129148
runs-on: ubuntu-latest
@@ -165,6 +184,13 @@ jobs:
165184
--region eu-west-2
166185
echo "✅ Uploaded artifact to s3://$BUCKET/artifacts/$TAG/lambda.zip"
167186
187+
- name: "Upload lambda artifact"
188+
uses: actions/upload-artifact@v4
189+
with:
190+
name: lambda-${{ needs.validate.outputs.dev_tag }}
191+
path: dist/lambda.zip
192+
if-no-files-found: error
193+
168194
deploy-to-test:
169195
name: "Deploy to Test (optional)"
170196
runs-on: ubuntu-latest
@@ -189,21 +215,11 @@ jobs:
189215
with:
190216
terraform_version: $(grep '^terraform' .tool-versions | cut -f2 -d' ')
191217

192-
- name: "Configure AWS Credentials (dev) - to download artifact"
193-
uses: aws-actions/configure-aws-credentials@v5
218+
- name: "Download lambda artifact"
219+
uses: actions/download-artifact@v4
194220
with:
195-
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/service-roles/github-actions-api-deployment-role
196-
aws-region: eu-west-2
197-
198-
- name: "Download lambda from S3 (dev bucket)"
199-
run: |
200-
TAG="${{ needs.validate.outputs.dev_tag }}"
201-
BUCKET="${{ needs.verify-artifact.outputs.s3_bucket }}"
202-
mkdir -p ./dist
203-
aws s3 cp \
204-
"s3://$BUCKET/artifacts/$TAG/lambda.zip" \
205-
./dist/lambda.zip \
206-
--region eu-west-2
221+
name: lambda-${{ needs.validate.outputs.dev_tag }}
222+
path: dist
207223

208224
- name: "Configure AWS Credentials (test)"
209225
uses: aws-actions/configure-aws-credentials@v5
@@ -296,42 +312,11 @@ jobs:
296312
with:
297313
terraform_version: $(grep '^terraform' .tool-versions | cut -f2 -d' ')
298314

299-
- name: "Determine source bucket (test or dev)"
300-
id: source
301-
run: |
302-
if [[ "${{ inputs.deploy_to_test }}" == "true" ]]; then
303-
echo "environment=test" >> $GITHUB_OUTPUT
304-
else
305-
echo "environment=dev" >> $GITHUB_OUTPUT
306-
fi
307-
308-
- name: "Configure AWS Credentials (source) - to download artifact"
309-
uses: aws-actions/configure-aws-credentials@v5
315+
- name: "Download lambda artifact"
316+
uses: actions/download-artifact@v4
310317
with:
311-
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/service-roles/github-actions-api-deployment-role
312-
aws-region: eu-west-2
313-
314-
- name: "Get source S3 bucket"
315-
id: source_bucket
316-
env:
317-
ENV: ${{ steps.source.outputs.environment }}
318-
run: |
319-
cd infrastructure
320-
make terraform env=$ENV stack=api-layer tf-command=init workspace=default
321-
cd stacks/api-layer
322-
BUCKET=$(terraform output -raw lambda_artifact_bucket)
323-
echo "name=$BUCKET" >> $GITHUB_OUTPUT
324-
echo "📦 Source bucket ($ENV): $BUCKET"
325-
326-
- name: "Download lambda from source S3"
327-
run: |
328-
TAG="${{ needs.validate.outputs.dev_tag }}"
329-
BUCKET="${{ steps.source_bucket.outputs.name }}"
330-
mkdir -p ./dist
331-
aws s3 cp \
332-
"s3://$BUCKET/artifacts/$TAG/lambda.zip" \
333-
./dist/lambda.zip \
334-
--region eu-west-2
318+
name: lambda-${{ needs.validate.outputs.dev_tag }}
319+
path: dist
335320

336321
- name: "Configure AWS Credentials (preprod)"
337322
uses: aws-actions/configure-aws-credentials@v5

0 commit comments

Comments
 (0)