mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-31 11:09:08 +00:00
Update CI/CD
This commit is contained in:
@@ -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 .
|
||||
|
||||
Reference in New Issue
Block a user