From 4ec2e6017ea38173f27fa45000af10411cbec3d0 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 19 Jan 2021 09:40:22 -0800 Subject: [PATCH 1/2] Use env context syntax for step variables Top-level environment variables cannot be referenced from jobs..steps[*].with using the direct environment variable syntax (e.g. $AWS_REGION) --- .../deploying-to-amazon-elastic-container-service.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/actions/guides/deploying-to-amazon-elastic-container-service.md b/content/actions/guides/deploying-to-amazon-elastic-container-service.md index 023472a4cbed..26aa1997efdb 100644 --- a/content/actions/guides/deploying-to-amazon-elastic-container-service.md +++ b/content/actions/guides/deploying-to-amazon-elastic-container-service.md @@ -103,7 +103,7 @@ jobs: with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: $AWS_REGION + aws-region: ${{ env.AWS_REGION }} - name: Login to Amazon ECR id: login-ecr @@ -126,16 +126,16 @@ jobs: id: task-def uses: aws-actions/amazon-ecs-render-task-definition@v1 with: - task-definition: $ECS_TASK_DEFINITION - container-name: $CONTAINER_NAME + task-definition: ${{ env.ECS_TASK_DEFINITION }} + container-name: ${{ env.CONTAINER_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: $ECS_SERVICE - cluster: $ECS_CLUSTER + service: ${{ env.ECS_SERVICE }} + cluster: ${{ env.ECS_CLUSTER }} wait-for-service-stability: true ``` {% endraw %} From 5bd67f0b868e93c2d0bd31ced132a94fcb30a10d Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 19 Jan 2021 09:47:38 -0800 Subject: [PATCH 2/2] ::set-output to send image name to steps context Redirecting to $GITHUB_ENV does not populate the ${{ steps.[*].outputs.* }} context --- .../guides/deploying-to-amazon-elastic-container-service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/actions/guides/deploying-to-amazon-elastic-container-service.md b/content/actions/guides/deploying-to-amazon-elastic-container-service.md index 26aa1997efdb..c6d5abde733c 100644 --- a/content/actions/guides/deploying-to-amazon-elastic-container-service.md +++ b/content/actions/guides/deploying-to-amazon-elastic-container-service.md @@ -120,7 +120,7 @@ jobs: # be deployed to ECS. 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_ENV + echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" - name: Fill in the new image ID in the Amazon ECS task definition id: task-def