ops(docker): publish Claw3D images from main.

Add a GHCR publishing workflow and expose a health endpoint so Fly deployments can build and pass runtime health checks.

Made-with: Cursor
This commit is contained in:
iamlukethedev
2026-04-07 17:22:06 -05:00
committed by iamlukethedev
parent fb3b146ed6
commit 0ba2abf6cc
2 changed files with 83 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
name: Docker Publish
on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/claw3d
jobs:
publish:
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: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Docker tags
id: tags
shell: bash
run: |
set -euo pipefail
tags=()
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
tags+=("${IMAGE_NAME}:main")
fi
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
version="${GITHUB_REF#refs/tags/v}"
tags+=("${IMAGE_NAME}:${version}")
tags+=("${IMAGE_NAME}:latest")
fi
if [[ ${#tags[@]} -eq 0 ]]; then
tags+=("${IMAGE_NAME}:manual")
fi
{
echo "value<<EOF"
printf "%s\n" "${tags[@]}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.tags.outputs.value }}
cache-from: type=gha
cache-to: type=gha,mode=max
+17
View File
@@ -0,0 +1,17 @@
import { NextResponse } from "next/server";
export const runtime = "nodejs";
export async function GET() {
return NextResponse.json(
{
ok: true,
service: "claw3d",
},
{
headers: {
"Cache-Control": "no-store",
},
},
);
}