-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.68 KB
/
Copy pathdevelop.yml
File metadata and controls
47 lines (43 loc) · 1.68 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
# 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
- ci-github-actions # 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: build docker image
id: build-docker-image
run: docker build -t ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} -t ${{ env.DOCKER_REPO }}:latest -t ${{ env.DOCKER_REPO }}:develop .
- 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: push to ecr
id: push-to-ecr
uses: jwalton/gh-ecr-push@v2
with:
region: ${{ secrets.AWS_REGION }}
local-image: ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }}
image: ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }}, ${{ env.DOCKER_REPO }}:latest, ${{ env.DOCKER_REPO }}:develop