-
Notifications
You must be signed in to change notification settings - Fork 7
44 lines (39 loc) · 1.28 KB
/
deploy-frontend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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