Skip to content

Deploying Consignment Export 0.0.448 to staging #577

Deploying Consignment Export 0.0.448 to staging

Deploying Consignment Export 0.0.448 to staging #577

Workflow file for this run

name: Deploy Consignment Export
permissions:
id-token: write
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: 'Environment'
required: true
options:
- intg
- staging
- prod
default: 'intg'
to-deploy:
description: 'Version to deploy'
required: true
run-name: Deploying Consignment Export ${{inputs.to-deploy}} to ${{inputs.environment}}
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials for ECR
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: arn:aws:iam::${{ secrets.MANAGEMENT_ACCOUNT }}:role/TDRGithubActionsRoleMgmt
aws-region: eu-west-2
role-session-name: ECRLogin
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: ${{ secrets.MANAGEMENT_ACCOUNT }}.dkr.ecr.eu-west-2.amazonaws.com
- name: Tag image
run: |
docker pull ${{ secrets.MANAGEMENT_ACCOUNT }}.dkr.ecr.eu-west-2.amazonaws.com/consignment-export:${{ github.event.inputs.to-deploy }}
docker tag ${{ secrets.MANAGEMENT_ACCOUNT }}.dkr.ecr.eu-west-2.amazonaws.com/consignment-export:${{ github.event.inputs.to-deploy }} ${{ secrets.MANAGEMENT_ACCOUNT }}.dkr.ecr.eu-west-2.amazonaws.com/consignment-export:${{ github.event.inputs.environment }}
docker push ${{ secrets.MANAGEMENT_ACCOUNT }}.dkr.ecr.eu-west-2.amazonaws.com/consignment-export:${{ github.event.inputs.environment }}
- name: Send success message
uses: nationalarchives/tdr-github-actions/.github/actions/slack-send@main
with:
message: "*consignment-export* :whale: The '${{ github.event.inputs.to-deploy }}' image has been tagged with '${{ github.event.inputs.environment }}' in ECR"
slack-url: ${{ secrets.SLACK_WEBHOOK }}
- name: Run E2E tests
if: inputs.environment != 'prod'
uses: octokit/[email protected]
with:
route: POST /repos/nationalarchives/tdr-e2e-tests/actions/workflows/ci.yml/dispatches
ref: master
inputs: "{\"environment\": \"${{ inputs.environment }}\", \"wait\": \"0\"}"
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }}