Skip to content

Commit

Permalink
fix(ci): use workflwo
Browse files Browse the repository at this point in the history
use workflow to run gha

fix(workflow): remove additional builds tep

fix(secrets): inherit secrest from caller
  • Loading branch information
seaerchin committed Feb 20, 2024
1 parent 94e72cd commit a5a225d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/aws_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ jobs:
- name: Build and push image to ECR
uses: docker/build-push-action@v4
with:
provenance: false
push: true
sbom: false
tags: ${{ steps.login-ecr.outputs.registry }}/${{ inputs.ecr-repository }}:${{ github.sha }}

deploy:
Expand All @@ -111,12 +109,6 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build and push image to ECR
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.login-ecr.outputs.registry }}/${{ inputs.ecr-repository }}:${{ github.sha }}

- name: Replace variables in task definition file
run: |
sed -i 's/<AWS_ACCOUNT_ID>/${{ secrets.AWS_ACCOUNT_ID }}/g' ${{ inputs.task-definition-path }}
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,27 +184,8 @@ jobs:
# NOTE: Not combining with above workflow to allow parallel execution
deploy_ecs:
name: Build and deploy to ECS
runs-on: ubuntu-latest
needs: [gatekeep]
if: needs.gatekeep.outputs.proceed == 'true'
steps:
- name: Deploy to ECS
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 }}

uses: ./.github/workflows/deploy_prod.yml
secrets: inherit

0 comments on commit a5a225d

Please sign in to comment.