From a97e3b52dc6758fcec9d0ec3d31d525db652969d Mon Sep 17 00:00:00 2001 From: Yury-Arashkevich Date: Tue, 28 May 2024 14:07:30 +0300 Subject: [PATCH] testing deployment added condition for tags --- .github/workflows/run_build.yaml | 2 -- .github/workflows/run_deploy_dev.yaml | 1 - .github/workflows/run_deploy_test.yaml | 4 ++++ .github/workflows/run_deploy_uat.yaml | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_build.yaml b/.github/workflows/run_build.yaml index 11940f1f010..4b533ca0144 100644 --- a/.github/workflows/run_build.yaml +++ b/.github/workflows/run_build.yaml @@ -61,7 +61,6 @@ jobs: deploy_to_uat: needs: run_codebuild_project uses: ChildMindInstitute/mindlogger-backend-refactor/.github/workflows/run_deploy_uat.yaml@develop - if: contains(github.ref, '-rc') with: COMMIT_HASH: ${{ github.sha }} IMAGE_PREFIX: ${{ github.ref_name }} @@ -69,7 +68,6 @@ jobs: deploy_to_test: needs: run_codebuild_project uses: ChildMindInstitute/mindlogger-backend-refactor/.github/workflows/run_deploy_test.yaml@develop - if: contains(github.ref, '-rc') with: COMMIT_HASH: ${{ github.sha }} IMAGE_PREFIX: ${{ github.ref_name }} \ No newline at end of file diff --git a/.github/workflows/run_deploy_dev.yaml b/.github/workflows/run_deploy_dev.yaml index e20c7e773c1..e1e3d21b220 100644 --- a/.github/workflows/run_deploy_dev.yaml +++ b/.github/workflows/run_deploy_dev.yaml @@ -42,7 +42,6 @@ jobs: - name: change image and register task definitions run: | NEW_IMAGE=${IMAGE_PREFIX/\//-}-$(echo $COMMIT_HASH | cut -c1-5) - for app in api worker scheduler; do export NEW_TASK_DEFINITION=$(aws ecs describe-task-definition --task-definition ${TASK_FAMILY_PREFIX}_${app} --region ${AWS_REGION} | jq --arg IMAGE "$ECR_REPO:$NEW_IMAGE" '.taskDefinition | .containerDefinitions[0].image = $IMAGE | del(.taskDefinitionArn) | del(.revision) | del(.status) | del(.requiresAttributes) | del(.compatibilities) | del(.registeredAt) | del(.registeredBy)') aws ecs register-task-definition --region ${AWS_REGION} --cli-input-json "$NEW_TASK_DEFINITION" diff --git a/.github/workflows/run_deploy_test.yaml b/.github/workflows/run_deploy_test.yaml index 87f10d90c7e..cc93e679fb3 100644 --- a/.github/workflows/run_deploy_test.yaml +++ b/.github/workflows/run_deploy_test.yaml @@ -1,5 +1,8 @@ name: deploy_to_test on: + push: + tags: + - '**' workflow_call: inputs: COMMIT_HASH: @@ -17,6 +20,7 @@ jobs: deploy_to_ecs: runs-on: ubuntu-latest + if: contains(github.ref, '-rc') env: TASK_FAMILY: backend_api ECS_CLUSTER_NAME: cmiml-test diff --git a/.github/workflows/run_deploy_uat.yaml b/.github/workflows/run_deploy_uat.yaml index a24fc7b8f27..72c1516ffa7 100644 --- a/.github/workflows/run_deploy_uat.yaml +++ b/.github/workflows/run_deploy_uat.yaml @@ -1,5 +1,8 @@ name: deploy_to_uat on: + push: + tags: + - '**' workflow_call: inputs: COMMIT_HASH: @@ -17,6 +20,7 @@ jobs: deploy_to_ecs: runs-on: ubuntu-latest + if: contains(github.ref, '-rc') env: TASK_FAMILY: backend_api ECS_CLUSTER_NAME: cmiml-uat