Update CI/CD

This commit is contained in:
alexsanderp
2022-02-04 10:20:45 -03:00
parent cb555b56b3
commit d92cd8d69e
+13 -1
View File
@@ -2,6 +2,8 @@ name: Deploy
on:
push:
branches:
- dev
- stg
- main
jobs:
@@ -11,6 +13,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Extract Environment
shell: bash
run: |
if [ ${GITHUB_REF} == "refs/heads/main" ]; then
echo "##[set-output name=result;]$(echo "prd")"
else
echo "##[set-output name=result;]$(echo ${GITHUB_REF#refs/heads/})"
fi
id: extract_environment
- name: Configure AWS Region
uses: aws-actions/configure-aws-credentials@v1
with:
@@ -27,7 +39,7 @@ jobs:
- name: Build, Tag, and Push Image to AWS ECR
env:
ECR_REGISTRY: ${{ steps.login_ecr.outputs.registry }}
ECR_REPOSITORY: microservices/maestro
ECR_REPOSITORY: microservices/maestro_${{ steps.extract_environment.outputs.result }}
IMAGE_TAG: latest
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .