Skip to content

Merge pull request #157 from AdaWorldAPI/claude/neo4j-rust-driver-u53PD #76

Merge pull request #157 from AdaWorldAPI/claude/neo4j-rust-driver-u53PD

Merge pull request #157 from AdaWorldAPI/claude/neo4j-rust-driver-u53PD #76

Workflow file for this run

# =============================================================================
# LadybugDB — Build & Push Release Image to GHCR
# =============================================================================
# Strategy: cargo-chef caches 586 dep crates in a Docker layer.
# Only ladybug's own 73K lines recompile on source changes.
# Railway pulls the pre-built image → zero build time on deploy.
#
# Trigger: push to main, or manual dispatch
# Output: ghcr.io/adaworldapi/ladybug-rs:latest
# ghcr.io/adaworldapi/ladybug-rs:sha-<commit>
# =============================================================================
name: Build & Release
on:
push:
branches: [main]
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'Dockerfile.release'
- '.github/workflows/build-release.yml'
workflow_dispatch:
inputs:
force_full_rebuild:
description: 'Force full rebuild (no cache)'
required: false
default: 'false'
type: boolean
env:
REGISTRY: ghcr.io
IMAGE_NAME: adaworldapi/ladybug-rs
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=sha-,format=short
type=ref,event=branch
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.release
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Force no-cache if requested
no-cache: ${{ github.event.inputs.force_full_rebuild == 'true' }}