Merge pull request #1182 from alphagov/FIX/remove-additional-character #183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy frontend | |
env: | |
DEPLOY_ROLE: arn:aws:iam::761723964695:role/build-auth-deploy-pipeline-GitHubActionsRole-160U5ADTRKQ2O | |
ARTIFACT_BUCKET: build-auth-deploy-pipeli-githubartifactsourcebuck-1o4hcrnik6ayv | |
on: | |
push: | |
branches: | |
- main | |
workflow_run: | |
workflows: ["Build frontend"] | |
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@v3 | |
- name: Set up AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ env.DEPLOY_ROLE }} | |
aws-region: eu-west-2 | |
- name: Upload frontend Terraform files | |
working-directory: ci/terraform | |
run: | | |
zip -r frontend.zip . | |
S3_RESPONSE=`aws s3api put-object \ | |
--bucket ${{ env.ARTIFACT_BUCKET }} \ | |
--key frontend.zip \ | |
--body frontend.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 |