Skip to content

Merge pull request #130 from cabinetoffice/release/10.0 #15

Merge pull request #130 from cabinetoffice/release/10.0

Merge pull request #130 from cabinetoffice/release/10.0 #15

Workflow file for this run

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: gap-apply-applicant-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 qa 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 gap-apply-applicant-backend --image-ids imageTag=qa --output json | jq --raw-output --join-output '.images[0].imageManifest')
aws ecr put-image --repository-name gap-apply-applicant-backend --image-tag prod --image-manifest "$MANIFEST"