Skip to content

Update README to reflect single-server CLI model #176

Update README to reflect single-server CLI model

Update README to reflect single-server CLI model #176

Workflow file for this run

name: Build and Push Docker Image
on:
pull_request:
push:
branches:
- "main"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
REGISTRY: ${{ vars.DOCKER_REGISTRY }}
PROJECT: ${{ vars.DOCKER_PROJECT }}
IMAGE_NAME: nebi
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
type=sha
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to Quay.io
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Build and maybe push
id: build
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
push: ${{ github.event_name == 'push' }}
load: ${{ github.event_name == 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke test
if: ${{ github.event_name == 'pull_request' }}
run: |
IMAGE_TAG="${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}"
echo "Testing image: ${IMAGE_TAG}"
# Start container with port mapping
docker run --rm -d --name test-nebi \
-p 8460:8460 \
-e NEBI_AUTH_JWT_SECRET=test-secret \
-e NEBI_DATABASE_DSN=/tmp/test.db \
${IMAGE_TAG}
# Wait for startup
sleep 10
# Check if container is still running
docker ps | grep test-nebi
# Check logs
docker logs test-nebi
# Test health endpoint from host (pixi image has no wget/curl)
curl -sf http://localhost:8460/api/v1/health || exit 1
# Cleanup
docker stop test-nebi
- name: Add image tags to summary
if: ${{ github.event_name == 'push' }}
run: |
echo "## 🐳 Docker Image Built: ${{ env.IMAGE_NAME }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Platforms:** linux/amd64" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Pull Command:" >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo "docker pull ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### All Tags:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }}" | sed 's/,/\n/g' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY