From f947851dbc646fb9284aee407d41923b3e4fcdc8 Mon Sep 17 00:00:00 2001 From: Artem Zhelezov <36639304+zhelezovartem@users.noreply.github.com> Date: Thu, 16 May 2024 16:48:47 +0500 Subject: [PATCH] remove hardcoded values from pipeline configuration --- .github/workflows/sub_deploy_to_beta.yml | 15 +++++++++------ .github/workflows/sub_deploy_to_prod.yml | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/sub_deploy_to_beta.yml b/.github/workflows/sub_deploy_to_beta.yml index f8652fd..81da95b 100644 --- a/.github/workflows/sub_deploy_to_beta.yml +++ b/.github/workflows/sub_deploy_to_beta.yml @@ -18,6 +18,9 @@ env: KOSLI_FLOW: ${{ vars.KOSLI_FLOW }} # custom-start-points-ci KOSLI_TRAIL: ${{ github.sha }} SERVICE_NAME: ${{ github.event.repository.name }} # custom-start-points + AWS_ECR_ID: ${{ vars.AWS_ECR_ID }} + AWS_REGION: ${{ vars.AWS_REGION }} + AWS_ACCOUNT_ID: ${{ vars.AWS_ACCOUNT_ID_BETA }} jobs: @@ -35,12 +38,12 @@ jobs: - name: Prepare outputs for fivexl deployment workflow id: vars run: | - echo "service_name=${{ env.SERVICE_NAME }}" >> ${GITHUB_OUTPUT} - echo "image_tag=${{ inputs.IMAGE_TAG }}" >> ${GITHUB_OUTPUT} - echo "aws_account_id=244531986313" >> ${GITHUB_OUTPUT} - echo "ecr_registry=244531986313.dkr.ecr.eu-central-1.amazonaws.com" >> ${GITHUB_OUTPUT} - echo "aws_region=eu-central-1" >> ${GITHUB_OUTPUT} - echo "gh_actions_iam_role_name=gh_actions_services" >> ${GITHUB_OUTPUT} + echo "service_name=${{ env.SERVICE_NAME }}" >> ${GITHUB_OUTPUT} + echo "image_tag=${{ inputs.IMAGE_TAG }}" >> ${GITHUB_OUTPUT} + echo "aws_account_id=${{ env.AWS_ACCOUNT_ID }}" >> ${GITHUB_OUTPUT} + echo "ecr_registry=${{ env.AWS_ECR_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com" >> ${GITHUB_OUTPUT} + echo "aws_region=${{ env.AWS_REGION }}" >> ${GITHUB_OUTPUT} + echo "gh_actions_iam_role_name=gh_actions_services" >> ${GITHUB_OUTPUT} push-image-to-beta-ecr: needs: [variables] diff --git a/.github/workflows/sub_deploy_to_prod.yml b/.github/workflows/sub_deploy_to_prod.yml index 1d1cc7c..add0d16 100644 --- a/.github/workflows/sub_deploy_to_prod.yml +++ b/.github/workflows/sub_deploy_to_prod.yml @@ -18,6 +18,9 @@ env: KOSLI_FLOW: ${{ vars.KOSLI_FLOW }} # custom-start-points-ci KOSLI_TRAIL: ${{ github.sha }} SERVICE_NAME: ${{ github.event.repository.name }} # custom-start-points + AWS_ECR_ID: ${{ vars.AWS_ECR_ID }} + AWS_REGION: ${{ vars.AWS_REGION }} + AWS_ACCOUNT_ID: ${{ vars.AWS_ACCOUNT_ID_PROD }} jobs: @@ -35,12 +38,12 @@ jobs: - name: Prepare outputs for fivexl deployment workflow id: vars run: | - echo "service_name=${{ env.SERVICE_NAME }}" >> ${GITHUB_OUTPUT} - echo "image_tag=${{ inputs.IMAGE_TAG }}" >> ${GITHUB_OUTPUT} - echo "aws_account_id=274425519734" >> ${GITHUB_OUTPUT} - echo "ecr_registry=244531986313.dkr.ecr.eu-central-1.amazonaws.com" >> ${GITHUB_OUTPUT} - echo "aws_region=eu-central-1" >> ${GITHUB_OUTPUT} - echo "gh_actions_iam_role_name=gh_actions_services" >> ${GITHUB_OUTPUT} + echo "service_name=${{ env.SERVICE_NAME }}" >> ${GITHUB_OUTPUT} + echo "image_tag=${{ inputs.IMAGE_TAG }}" >> ${GITHUB_OUTPUT} + echo "aws_account_id=${{ env.AWS_ACCOUNT_ID }}" >> ${GITHUB_OUTPUT} + echo "ecr_registry=${{ env.AWS_ECR_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com" >> ${GITHUB_OUTPUT} + echo "aws_region=${{ env.AWS_REGION }}" >> ${GITHUB_OUTPUT} + echo "gh_actions_iam_role_name=gh_actions_services" >> ${GITHUB_OUTPUT} deploy-to-aws-prod: needs: [variables]