Skip to content

move Docker docs to doc site #18

move Docker docs to doc site

move Docker docs to doc site #18

Workflow file for this run

name: Build and Publish Docker Images
on:
push:
branches:
- main
paths:
- 'docker/**'
- '.github/workflows/build-docker.yml'
workflow_dispatch:
workflow_run:
workflows: ["Bump Version, Build and Publish Python"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
if: |
${{
github.event_name != 'push' ||
!contains(join(github.event.head_commit.modified, ','), 'fastapi_agents') &&
!contains(join(github.event.head_commit.modified, ','), 'pyproject.toml') &&
!contains(join(github.event.head_commit.modified, ','), 'uv.lock') &&
!contains(join(github.event.head_commit.modified, ','), '.github/workflows/build-python.yml')
}}
&& ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Tag Images
run: |
DOCKERFILE_PATH=docker/Dockerfile
PACKAGE_VERSION=0.1
for FRAMEWORK in pydantic-ai smolagents llama-index crewai; do
IMAGE_NAME=ghcr.io/blairhudson/fastapi-agents:$FRAMEWORK
VERSIONED_IMAGE_NAME=ghcr.io/blairhudson/fastapi-agents:$FRAMEWORK-$PACKAGE_VERSION
echo "Building image for $FRAMEWORK..."
docker build \
--build-arg AGENT_FRAMEWORK=$FRAMEWORK \
--build-arg PACKAGE_VERSION=$PACKAGE_VERSION \
-t $IMAGE_NAME \
-t $VERSIONED_IMAGE_NAME \
-f $DOCKERFILE_PATH docker/
echo "Pushing images for $FRAMEWORK..."
docker push $IMAGE_NAME
docker push $VERSIONED_IMAGE_NAME
done