chore: heygermany customer project
Some checks failed
Main / Setup and Test (push) Has been cancelled
Main / Build Website (push) Has been cancelled

This commit is contained in:
e2e
2026-07-11 10:06:51 +02:00
commit 373b42a994
398 changed files with 38262 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
name: Build and Push to ECR
description: Fully prepares, builds, and pushes a Docker image to AWS ECR.
inputs:
dockerfile:
description: 'Path to Dockerfile'
required: true
image-name:
description: 'ECR repo name (e.g. api or dbmigrate)'
required: true
aws-region:
description: 'AWS region'
required: true
aws-access-key-id:
description: 'AWS Access Key ID'
required: true
aws-secret-access-key:
description: 'AWS Secret Access Key'
required: true
github-sha:
description: 'Commit SHA to tag the image with'
default: ${{ github.sha }}
outputs:
ecr_image:
description: 'Final ECR image URI'
value: ${{ steps.build.outputs.ecr_image }}
runs:
using: composite
steps:
- name: Setup AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}
- name: Login to Amazon ECR
id: ecr-login
uses: aws-actions/amazon-ecr-login@v1
- name: Download generated files
uses: actions/download-artifact@v4
with:
name: generated-code
path: ${{ github.workspace }}
- name: List generated files
shell: bash
run: |
echo "Listing .gen.ts and .gen.d.ts files:"
pwd
find . -name "*.gen.ts" -o -name "*.gen.d.ts"
- name: Build and Push Docker Image
shell: bash
id: build
run: |
IMAGE_URI=${{ steps.ecr-login.outputs.registry }}/${{ inputs.image-name }}:${{ inputs.github-sha }}
docker build -t $IMAGE_URI -f ${{ inputs.dockerfile }} .
docker tag $IMAGE_URI ${{ steps.ecr-login.outputs.registry }}/${{ inputs.image-name }}:latest
docker push $IMAGE_URI
docker push ${{ steps.ecr-login.outputs.registry }}/${{ inputs.image-name }}:latest
# Safe base64 encode and output
IMAGE_URI_BASE64=$(echo -n "$IMAGE_URI" | base64 | tr -d '\n')
echo "ecr_image=$IMAGE_URI_BASE64" >> $GITHUB_OUTPUT