Skip to content

Commit b10f222

Browse files
committed
Pass image URI as output/input
1 parent 11ce09a commit b10f222

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.github/actions/build-push-artifacts/action.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,11 @@ runs:
4747
file: ci/Dockerfile
4848
context: .
4949
push: true
50-
tags: ${{ steps.login-ecr-vaec.outputs.registry }}/va_enp_api:${{ inputs.ref }},${{ steps.login-ecr-vaec.outputs.registry }}/va_enp_api:${{ github.sha }} ## Tagging with branch/tag and SHA to maintain SHA record and human readability
50+
tags: ${{ steps.login-ecr-vaec.outputs.registry }}/va_enp_api:${{ inputs.ref }},${{ steps.login-ecr-vaec.outputs.registry }}/va_enp_api:${{ github.sha }} ## Tagging with branch/tag and SHA to maintain SHA record and human readability
51+
52+
# This step sets the Docker image URI as an output from the composite action
53+
- name: Set image output
54+
shell: bash
55+
run: |
56+
# Using the ref tag as our main object to pass around
57+
echo "image=${{ steps.login-ecr-vaec.outputs.registry }}/va_enp_api:${{ inputs.ref }}" >> $GITHUB_OUTPUT

.github/actions/ecs-task-render-deploy/action.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ runs:
7272
image: ${{ inputs.image }}
7373

7474
- name: Deploy API task definition to Fargate
75-
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
76-
with:
77-
task-definition: ./task-definition.json
78-
service: ${{ inputs.environment }}-va-enp-api-service
79-
cluster: ${{ inputs.environment }}-notification-cluster
80-
wait-for-service-stability: true
75+
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
76+
with:
77+
task-definition: ./task-definition.json
78+
service: ${{ inputs.environment }}-va-enp-api-service
79+
cluster: ${{ inputs.environment }}-notification-cluster
80+
wait-for-service-stability: true

.github/workflows/deploy.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
ref: ${{ inputs.ref }}
3232

3333
- name: Build and Push Artifacts
34+
id: build_and_push
3435
uses: ./.github/actions/build-push-artifacts
3536
with:
3637
ref: ${{ inputs.ref }}
@@ -44,11 +45,12 @@ jobs:
4445
with:
4546
task-definition-path: "./cd/va-enp-api-task-definition.json"
4647
container-name: "${{ inputs.environment }}-va-enp-api"
47-
image: nginx:latest ## using this for now because we don't have ENP images yet
48+
image: ${{ steps.build_and_push.outputs.image }}
4849
aws-access-key-id: ${{ secrets.VAEC_AWS_ACCESS_KEY_ID }}
4950
aws-secret-access-key: ${{ secrets.VAEC_AWS_SECRET_ACCESS_KEY }}
5051
aws-region: ${{ secrets.AWS_REGION }}
5152
role-to-assume: ${{ secrets.VAEC_DEPLOY_ROLE }}
53+
environment: ${{ inputs.environment }}
5254
env:
5355
AWS_ARN_REGION: ${{ secrets.AWS_ARN_REGION }}
5456
AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_NUMBER }}

0 commit comments

Comments
 (0)