-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 1.86 KB
/
Copy pathdevelop.yml
File metadata and controls
56 lines (50 loc) · 1.86 KB
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
51
52
53
54
55
56
# this workflow is triggered when a PR to the develop branch is merged.
# the following steps are performed:
# - build docker image and push to ECR (image tag is the git describe output as well as 'latest')
# - deploy image to staging environment
name: develop branch workflow
on:
push:
branches:
- develop
- main # temporary until we get a "develop" branch set up
- jt-iss-28-design-changes # temporary branch for testing, to be removed once workflow is verified
permissions:
id-token: write
jobs:
build-push-deploy:
runs-on: ubuntu-latest
steps:
- name: checkout code
id: checkout-code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: save command output
id: save-command-output
run: |
echo "DOCKER_REPO=analytics-dashboard-ui" >> $GITHUB_ENV
echo "DOCKER_TAG=$(git describe)" >> $GITHUB_ENV
- name: configure aws credentials
id: configure-aws-credentials
uses: aws-actions/configure-aws-credentials@v6.1.0
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: build and push docker image
id: build-push-docker-image
run: |
docker buildx build \
--platform linux/arm64 \
--push \
-t ${{ steps.login-ecr.outputs.registry }}/${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} \
-t ${{ steps.login-ecr.outputs.registry }}/${{ env.DOCKER_REPO }}:latest \
-t ${{ steps.login-ecr.outputs.registry }}/${{ env.DOCKER_REPO }}:develop \
.