Skip to content

Build ECR images

Build ECR images #46

name: Build ECR images
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to post the image to'
required: true
type: string
workflow_call:
inputs:
environment:
description: 'Environment to post the image to'
required: true
type: string
version:
description: 'Version tag to apply to image'
required: true
type: string
permissions:
id-token: write
contents: read
defaults:
run:
working-directory: ./server
jobs:
build-and-push:
name: Build indexify server and push to ${{ inputs.environment }}
environment: ${{ inputs.environment }}
runs-on: namespace-profile-indexify-builder
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: github-actions-platform-api
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
context: server/
file: server/dockerfiles/Dockerfile.local
outputs: type=image,push=true,image-manifest=true,oci-mediatypes=true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ steps.login-ecr.outputs.registry }}/indexify-server:${{ github.sha }}
${{ steps.login-ecr.outputs.registry }}/indexify-server:latest