Skip to content

Release 0.4.1

Release 0.4.1 #26

Workflow file for this run

name: Deploy
permissions:
id-token: write
contents: read
on:
push:
tags:
- v*
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
cache: yarn
- name: Install dependencies
run: yarn install
- name: Install playwright
run: yarn workspace test playwright install
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE }}
- name: Login to Amazon ECR
id: login
uses: aws-actions/amazon-ecr-login@v2
- name: Run smoke tests
run: yarn workspace test smoke
env:
ECR_REGISTRY: ${{ steps.login.outputs.registry }}
TAG: ${{ github.ref_name }}
- name: Stop app
if: always()
continue-on-error: true
run: yarn stop
- name: Publish images to Amazon ECR
run: |
docker push $ECR_REGISTRY/mpr-api:$TAG
docker push $ECR_REGISTRY/mpr-app:$TAG
env:
ECR_REGISTRY: ${{ steps.login.outputs.registry }}
TAG: ${{ github.ref_name }}
- name: Download task definition
run: |
aws ecs describe-task-definition --task-definition mpr-api --query taskDefinition > api/task-definition.json
aws ecs describe-task-definition --task-definition mpr-app --query taskDefinition > app/task-definition.json
- name: Render updated task definition for api
id: mpr-api
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: api/task-definition.json
container-name: api
image: ${{ steps.login.outputs.registry }}/mpr-api:${{ github.ref_name }}
- name: Render updated task definition for app
id: mpr-app
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: app/task-definition.json
container-name: app
image: ${{ steps.login.outputs.registry }}/mpr-app:${{ github.ref_name }}
- name: Deploy api
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.mpr-api.outputs.task-definition }}
service: ${{ secrets.MPR_API_SERVICE }}
cluster: mpr
wait-for-service-stability: true
- name: Deploy app
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.mpr-app.outputs.task-definition }}
service: ${{ secrets.MPR_APP_SERVICE }}
cluster: mpr
wait-for-service-stability: true