From cb555b56b30ad8ec1a013458533ec5326b705143 Mon Sep 17 00:00:00 2001 From: alexsanderp Date: Fri, 4 Feb 2022 10:18:37 -0300 Subject: [PATCH] Adding github workflow --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..82f0425 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Deploy +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: self-hosted + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Configure AWS Region + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: us-east-1 + + - name: Install AWS CLI + run: | + python3 -m pip install awscli + + - name: Login to AWS ECR + id: login_ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Build, Tag, and Push Image to AWS ECR + env: + ECR_REGISTRY: ${{ steps.login_ecr.outputs.registry }} + ECR_REPOSITORY: microservices/maestro + IMAGE_TAG: latest + run: | + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG