-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.61 KB
/
build-qa.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
45
46
47
48
49
50
name: Deploy QA
# on:
# workflow_run:
# workflows: ["CI"]
# types:
# - completed
on:
push:
branches:
- MLN-1304
permissions:
id-token: write
contents: read
jobs:
deploy_qa:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'MLN-1304' }}
name: Deploy QA
runs-on: ubuntu-latest
environment: qa
steps:
- name: checkout
uses: actions/checkout@v2
- name: Configure AWS credentials for QA environment account
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::946183545209:role/GithubActionsDeployerRole
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: my-library-nyc-app
IMAGE_TAG: ${{ github.sha }}
run: |
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:qa-latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:qa-latest
- name: Force ECS Update
run: |
aws ecs update-service --cluster mylibrarynycapp-qa --service mylibrarynycapp-qa --force-new-deployment
aws ecs update-service --cluster mylibrarynycapp-qa --service mylibrarynycapp-qa-delayed-job --force-new-deployment