aletheiadb 0.1.1

A high-performance bi-temporal graph database for LLM integration
Documentation
name: Docker Image

# Build and publish the `aletheiadb` container image to GitHub Container
# Registry. Triggers:
#   - push to trunk      -> `:trunk` and `:sha-<commit>`
#   - semver tag vX.Y.Z  -> `:vX.Y.Z`, `:X.Y`, `:latest`, and `:sha-<commit>`
#   - manual workflow_dispatch (for rebuilding without a new commit/tag)
#
# Images are linux/amd64 for the first pass. linux/arm64 is easy to add to
# the platforms list once someone actually asks for it; it doubles build
# time without any current consumer, so we keep it off by default.

on:
  push:
    branches:
      - trunk
    tags:
      - 'v*.*.*'
  workflow_dispatch:

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  build-and-push:
    name: Build and push Docker image
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v4

      - name: Log in to GHCR
        uses: docker/login-action@v3
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Extract metadata (tags, labels)
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          tags: |

            type=ref,event=branch
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=sha,prefix=sha-,format=short
            type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}

      - name: Build and push
        uses: docker/build-push-action@v7
        with:
          context: .
          file: ./Dockerfile
          push: true
          platforms: linux/amd64
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          # BuildKit cache keyed on the GitHub Actions cache backend. Keeps
          # Cargo's dependency compile cost (usearch, tokio, autumn, etc.)
          # off the critical path for incremental builds.
          cache-from: type=gha
          cache-to: type=gha,mode=max