Skip to content

Commit 1eda9b6

Browse files
committed
Add action to build and push image
1 parent f48c879 commit 1eda9b6

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'Builds and Push Artifacts'
2+
description: 'Builds and pushes a Docker image'
3+
inputs:
4+
ref:
5+
description: 'Git reference (commit SHA, branch, or tag) to build'
6+
required: true
7+
aws-access-key-id:
8+
description: 'AWS Access Key ID'
9+
required: true
10+
aws-secret-access-key:
11+
description: 'AWS Secret Access Key'
12+
required: true
13+
aws-region:
14+
description: "AWS region to push to"
15+
required: true
16+
role-to-assume:
17+
description: 'AWS role to assume'
18+
required: true
19+
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Checkout Repo
24+
uses: actions/checkout@v4
25+
with:
26+
ref: ${{ inputs.ref }}
27+
28+
- name: Configure VAEC AWS Credentials
29+
uses: aws-actions/configure-aws-credentials@v4
30+
with:
31+
aws-access-key-id: ${{ inputs.aws-access-key-id }}
32+
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
33+
aws-region: ${{ inputs.aws-region }}
34+
role-to-assume: ${{ inputs.role-to-assume }}
35+
role-skip-session-tagging: true
36+
role-duration-seconds: 900
37+
38+
- name: Login to VAEC ECR
39+
id: login-ecr-vaec
40+
uses: aws-actions/amazon-ecr-login@v2
41+
with:
42+
mask-password: 'true'
43+
44+
- name: Docker Build
45+
uses: docker/build-push-action@v6
46+
with:
47+
file: ci/Dockerfile
48+
context: .
49+
push: true
50+
tags: ${{ steps.login-ecr-vaec.outputs.registry }}/notification_api:${{ inputs.ref }}

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ runs:
5050
run: |
5151
echo "Rendering template with envsubst..."
5252
# Substitute environment variables in the task definition file
53-
envsubst < "${{ inputs.task-definition-path }}" > task-definition.json
53+
envsubst < "${{ inputs.task-definition-path }}" > pre-rendered-task-definition.json
54+
55+
- name: Additional Rendering for Double Interpolation
56+
id: pre_render
57+
shell: bash
58+
run: |
59+
echo "Rendering template with envsubst..."
60+
# Substitute environment variables in the task definition file
61+
envsubst < pre-rendered-task-definition.json > task-definition.json
5462
5563
- name: Render Task Definition
5664
id: render

0 commit comments

Comments
 (0)