From f936d49ec428dc3653b485158ccce753fe37d39a Mon Sep 17 00:00:00 2001 From: seaerchin <44049504+seaerchin@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:14:16 +0800 Subject: [PATCH] feat(deploy-prod): add workflwo to deploy to production (#1134) --- .github/workflows/ci.yml | 13 ++++++++++++- .github/workflows/deploy_prod.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy_prod.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97a2fb012..0469e26f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,7 +107,7 @@ jobs: else: print('::set-output name=proceed::false') - deploy: + deploy_eb: name: Build and deploy to EB runs-on: ubuntu-latest needs: [gatekeep] @@ -180,3 +180,14 @@ jobs: deployment_package: deploy.zip wait_for_deployment: true wait_for_environment_recovery: true + + # NOTE: Not combining with above workflow to allow parallel execution + deploy_ecs: + name: Build and deploy to EB + runs-on: ubuntu-latest + needs: [gatekeep] + if: needs.gatekeep.outputs.proceed == 'true' + steps: + - name: Deploy to ECS + uses: ./.github/wworkflows/deploy_prod.yml + \ No newline at end of file diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml new file mode 100644 index 000000000..4f76e8ab7 --- /dev/null +++ b/.github/workflows/deploy_prod.yml @@ -0,0 +1,30 @@ +name: Deploy to production + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +on: + workflow_call: + +jobs: + deploy: + name: Deploy + uses: ./.github/workflows/aws_deploy.yml + with: + aws-region: "ap-southeast-1" + cicd-role: "arn:aws:iam::095733531422:role/isomer-infra-github-oidc-role-16ea937" + ecr-repository: "isomer-infra-prod-ecr" + ecs-cluster-name: "isomer-prod-ecs" + ecs-web-service-name: "isomer-prod-ecs-service" + ecs-container-name: "backend" + environment: "prod" + shortEnv: "prod" + task-definition-path: ".aws/deploy/backend-task-definition.prod.json" + codedeploy-application: "isomer-prod-ecs-app" + codedeploy-deployment-group: "isomer-prod-ecs-dg" + + secrets: + AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} + EFS_FILE_SYSTEM_ID: ${{ secrets.PROD_EFS_FILE_SYSTEM_ID }} + DD_API_KEY: ${{ secrets.DD_API_KEY }}