Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deploy-prod): add step to ci.yml to deploy to production #1134

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading