Skip to content

Commit

Permalink
pr adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
mfar committed May 17, 2024
1 parent e719947 commit 6198b59
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 86 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ on:
permissions:
id-token: write
contents: read
env:
ECR_REPOSITORY: development-identity
AWS_ROLE_ARN: arn:aws:iam::665230337498:role/development-identity-github-actions
AWS_REGION: us-west-2
ECS_SERVICE: development-identity-service
ECS_CLUSTER: development-identity-cluster
ENVIRONMENT: development


jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -31,15 +24,15 @@ jobs:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Log in to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
IMAGE_TAG: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}
IMAGE_TAG: ${{ steps.login-ecr.outputs.registry }}/${{ vars.ECR_REPOSITORY }}:${{ github.sha }}
run: |
docker build -t $IMAGE_TAG -f ./apps/api/Dockerfile .
docker push $IMAGE_TAG
Expand All @@ -48,15 +41,17 @@ jobs:
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ./apps/api/.aws/task-definition-${{ env.ENVIRONMENT }}.json
task-definition: ./apps/api/.aws/task-definition-${{ vars.ENVIRONMENT }}.json
container-name: development-identity
image: ${{ steps.build-image.outputs.image }}
environment-variables: |
AWS_REGION=${{ env.AWS_REGION }}
AWS_REGION=${{ vars.AWS_REGION }}
API_ENV_SECRET_NAME=${{ vars.API_ENV_SECRET_NAME }}
DATABASE_SECRET_NAME=${{ vars.DATABASE_SECRET_NAME }}
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
service: ${{ vars.ECS_SERVICE }}
cluster: ${{ vars.ECS_CLUSTER }}
wait-for-service-stability: true
20 changes: 1 addition & 19 deletions apps/api/.aws/task-definition-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,7 @@
}
],
"essential": true,
"environment": [
{
"name": "AWS_REGION",
"value": "us-west-2"
},
{
"name": "API_ENV_SECRET_NAME",
"value": "tdkApiEnv"
},
{
"name": "DATABASE_SECRET_NAME",
"value": "development-identity-db"
}
],
"environment": [],
"mountPoints": [],
"volumesFrom": [],
"linuxParameters": {
Expand Down Expand Up @@ -63,12 +50,7 @@
"executionRoleArn": "arn:aws:iam::665230337498:role/development-identity-service-20240515023426696600000003",
"networkMode": "awsvpc",
"volumes": [],
"status": "ACTIVE",
"placementConstraints": [],
"compatibilities": [
"EC2",
"FARGATE"
],
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
Expand Down
51 changes: 0 additions & 51 deletions apps/api/.aws/task-definition-development.json~

This file was deleted.

0 comments on commit 6198b59

Please sign in to comment.