updating wflow #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- nikita | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
AWS_ACCESS_KEY_ID: AKIA5ZOUUDPV4JSVHC5U | |
AWS_SECRET_ACCESS_KEY: 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 | |
AWS_DEFAULT_REGION: us-west-1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to ECR | |
env: | |
AWS_REGION: us-west-1 | |
run: | | |
aws ecr get-login-password --region us-west-1 | docker login --username AWS --password-stdin 948023073771.dkr.ecr.us-west-1.amazonaws.com | |
- name: Build Docker image | |
run: docker build -t fastapi-demo . | |
- name: Tag Docker image | |
run: docker tag fastapi-demo:latest 948023073771.dkr.ecr.us-west-1.amazonaws.com/fastapi-demo:latest | |
- name: Push Docker image to ECR | |
run: docker push 948023073771.dkr.ecr.us-west-1.amazonaws.com/fastapi-demo:latest |