Skip to content

Commit eec389f

Browse files
committed
Correctly set up image tag
1 parent 9ea0eff commit eec389f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/deploy.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,19 @@ jobs:
2424
role-to-assume: arn:aws:iam::200049542062:role/gocapture/GithubRole
2525
aws-region: us-west-1
2626

27+
- name: Login to Amazon ECR
28+
id: login-ecr
29+
uses: aws-actions/amazon-ecr-login@v1
30+
2731
- name: Deploy ECS Cluster
32+
env:
33+
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
34+
REPOSITORY: go-capture
35+
IMAGE_TAG: ${{ github.sha }}
2836
uses: aws-actions/aws-cloudformation-github-deploy@v1
2937
with:
3038
name: GoCaptureECSCluster
3139
capabilities: CAPABILITY_NAMED_IAM
32-
parameter-overrides: "TaskImage=$REGISTRY/$REPOSITORY:$IMAGE_TAG"
40+
parameter-overrides: "TaskImage=${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}"
3341
template: cloud-formation/ecs.yaml
3442
no-fail-on-empty-changeset: 1

cloud-formation/github-role.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Resources:
5151
iam:GetRole,
5252
iam:GetUser,
5353
iam:ListAccessKeys,
54-
iam:PassRole,
5554
iam:PutRolePolicy,
5655
iam:PutRoleRole,
5756
iam:PutUserPolicy,
@@ -96,7 +95,8 @@ Resources:
9695
"Action": [
9796
"ecs:CreateCluster",
9897
"ecs:DescribeClusters",
99-
"ecs:RegisterTaskDefinition"
98+
"ecs:RegisterTaskDefinition",
99+
"iam:PassRole"
100100
],
101101
"Resource": "*"
102102
}

0 commit comments

Comments
 (0)