-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.22 KB
/
promoteToProd.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
name: Promote to Prod Workflow
on:
push:
branches:
- main
paths-ignore:
- '*.md'
env:
AWS_REGION: eu-west-2
jobs:
promoteToProd:
environment: AWS
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: github-gap-find-backend
aws-region: ${{ env.AWS_REGION }}
- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Add prod tag to existing test image
# Based on steps described here - https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-retag.html
run: |
MANIFEST=$(aws ecr batch-get-image --repository-name find-a-grant-api --image-ids imageTag=test --output json | jq --raw-output --join-output '.images[0].imageManifest')
aws ecr put-image --repository-name find-a-grant-api --image-tag prod --image-manifest "$MANIFEST"