Skip to content

Fargate deployment

Fargate deployment #21

Workflow file for this run

name: Push to ECR
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Push to ECR
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: '${{ secrets.AWS_ACCESS_KEY_ID }}'
aws-secret-access-key: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
aws-region: us-east-1
- name: Get ECR Repository URI
id: fetch-ecr-repo
run: |
export REPOSITORY_URI=$(aws ssm get-parameter --name "/config/observation-tracker/repository.uri" --with-decryption --query Parameter.Value --output text)
echo "::set-output name=repository_uri::$REPOSITORY_URI"
- name: Login to Amazon ECR
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: 'Build, tag, and push image to Amazon ECR'
working-directory: api/
run: |
docker build -t ${{ steps.fetch-ecr-repo.outputs.repository_uri }}:latest .
docker push ${{ steps.fetch-ecr-repo.outputs.repository_uri }}:latest