Skip to content

Commit

Permalink
Reading env name path updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
sshrihar committed Mar 20, 2024
1 parent d1fa878 commit 4b81e0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
uses: aws-actions/configure-aws-credentials@v3
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::${{ steps.get_account_number.outputs.ACCOUNT_NUMBER }}:role/$APP_NAME-GithubActionsRole
role-to-assume: arn:aws:iam::${{ steps.get_account_number.outputs.ACCOUNT_NUMBER }}:role/${{ env.APP_NAME }}-GithubActionsRole
role-session-name: GithubActionsSession

- name: Login to Amazon ECR
Expand All @@ -65,28 +65,28 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
ECR_REPOSITORY: "$APP_NAME-ecr"
ECR_REPOSITORY: "${{ env.APP_NAME }}-ecr"
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Extract directory path
run: |
echo "TASKDEF_FILE=.github/taskdefinition_template/$APP_NAME.json" >> $GITHUB_ENV
echo "TASKDEF_FILE=.github/taskdefinition_template/${{ env.APP_NAME }}.json" >> $GITHUB_ENV
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: "${{ env.TASKDEF_FILE }}"
container-name: "$APP_NAME"
container-name: "${{ env.APP_NAME }}"
image: ${{ steps.build-image.outputs.image }}

- 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: "$APP_NAME-ecs-service"
service: "${{ env.APP_NAME }}-ecs-service"
cluster: "frontend-${{ inputs.environment }}-ecs-cluster"
wait-for-service-stability: true

0 comments on commit 4b81e0f

Please sign in to comment.