Skip to content

.github/workflows/build-and-push-docker-image.yml #5

.github/workflows/build-and-push-docker-image.yml

.github/workflows/build-and-push-docker-image.yml #5

on:
workflow_dispatch:
inputs:
langtrace-ingest-image-tag:
description: 'Langtrace Ingress Docker image tag'
required: false
langtrace-ui-image-tag:
description: 'Langtrace UI Docker image tag'
required: false
langtrace-api-image-tag:
description: 'Langtrace API Docker image tag'
required: false
jobs:
push_ingest_to_ghcr:
if: ${{ !cancelled() && inputs.langtrace-ingest-image-tag != null }}
name: Build and push Langtrace ingest component to Github Container Registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Log in to the Container registry
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for Docker build
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: ghcr.io/${{ github.repository_owner }}/langtrace-ingest
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}},value=${{ inputs.langtrace-ingest-image-tag }}
- name: Build and push Docker image
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5
with:
file: ./Dockerfile.ingest
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push_ui_to_ghcr:
if: ${{ !cancelled() && inputs.langtrace-ui-image-tag != null }}
name: Build and push Langtrace UI component to Github Container Registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Log in to the Container registry
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for Docker build
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: ghcr.io/${{ github.repository_owner }}/langtrace-ui
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}},value=${{ inputs.langtrace-ui-image-tag }}
- name: Build and push Docker image
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5
with:
file: ./Dockerfile.ui
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# This is here to placate the build process and can be overridden at runtime.
build-args: |
LANGTRACE_API_URL=http://localhost:1994
push_api_to_ghcr:
if: ${{ !cancelled() && inputs.langtrace-api-image-tag != null }}
name: Build and push Langtrace API component to Github Container Registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Log in to the Container registry
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for Docker build
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: ghcr.io/${{ github.repository_owner }}/langtrace-api
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}},value=${{ inputs.langtrace-api-image-tag }}
- name: Build and push Docker image
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5
with:
file: ./Dockerfile.api
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}