Skip to content

Commit

Permalink
feat(deploy-prod): add workflwo to deploy to production (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin authored Feb 19, 2024
1 parent 3dfbc0e commit f936d49
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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

30 changes: 30 additions & 0 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit f936d49

Please sign in to comment.