Skip to content

For the win

For the win #11

Workflow file for this run

name: Push to ECR
'on':
- push
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
run: |
export REPOSITORY_URI=$(aws ssm get-parameter --name "/config/observation-tracker/repository.uri" --with-decryption --query Parameter.Value --output text)
- 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'
env:
IMAGE_TAG: '${{ github.sha }}'
working-directory: api/
run: |
echo $REPOSITORY_URI
docker build -t $REPOSITORY_URI:$IMAGE_TAG .
docker push $REPOSITORY_URI:$IMAGE_TAG