Skip to content

Deploy Utils

Deploy Utils #1027

Workflow file for this run

name: Deploy Utils
env:
AWS_REGION: eu-west-2
#gha role is build Auth github actions role in Gds dev Account
#Artifact bucket is Build Auth deploy github artifcat Source bucket
#Destination Bucket is auth-lambda-signed bucket from prod tooling account
on:
workflow_run:
workflows: ["Build modules"]
types:
- completed
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
role-to-assume: ${{ secrets.GHA_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: Download and copy Utils signed lambda zip
working-directory: ci/terraform/utils
run: |
aws s3 cp s3://${{ secrets.DESTINATION_BUCKET }} ./artifacts \
--recursive --exclude "*" \
--include "signed-utils-${{ github.sha }}-*"
mv artifacts/signed-utils-*.zip artifacts/utils.zip
- name: Upload Utils Terraform files
working-directory: ci/terraform
run: |
zip -r utils.zip .
S3_RESPONSE=`aws s3api put-object \
--bucket ${{ secrets.ARTIFACT_BUCKET }} \
--key utils.zip \
--body utils.zip \
--metadata "repository=$GITHUB_REPOSITORY,commitsha=$GITHUB_SHA,committag=$GIT_TAG,commitmessage=$COMMIT_MSG"`
VERSION=`echo $S3_RESPONSE | jq .VersionId -r`
echo "VERSION=$VERSION" >> $GITHUB_ENV