name: Build CUDA image (fork) # Builds this fork's llama-swap (serial scheduler + embedded UI) from source and # layers it on a pinned llama.cpp CUDA server base, then pushes to the Gitea # container registry, e.g. gitea.stevedudenhoeffer.com/steve/llama-swap:v230-cuda-b9821 # # Requires repo secrets: REGISTRY_USER, REGISTRY_PASSWORD (push to the registry). on: workflow_dispatch: inputs: llama_swap_version: description: "llama-swap version label (image tag prefix)" required: false default: "v230" llamacpp_build: description: "llama.cpp CUDA server build (base image tag suffix)" required: false default: "b9821" # Building the build definition itself kicks off a fresh image. push: branches: [main] paths: - ".gitea/workflows/build-cuda-image.yml" - "docker/fork-cuda.Containerfile" env: REGISTRY: gitea.stevedudenhoeffer.com jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Compute image metadata id: meta run: | LS_VER="${{ inputs.llama_swap_version || 'v230' }}" LCPP="${{ inputs.llamacpp_build || 'b9821' }}" { echo "image=${REGISTRY}/${{ github.repository }}" echo "tag=${LS_VER}-cuda-${LCPP}" echo "base_tag=server-cuda-${LCPP}" echo "ls_version=${LS_VER}" echo "build_date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" } >> "$GITHUB_OUTPUT" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Gitea registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} - name: Build and push uses: docker/build-push-action@v6 with: context: . file: docker/fork-cuda.Containerfile push: true provenance: false build-args: | BASE_TAG=${{ steps.meta.outputs.base_tag }} LS_VERSION=${{ steps.meta.outputs.ls_version }} GIT_HASH=${{ github.sha }} BUILD_DATE=${{ steps.meta.outputs.build_date }} tags: ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.tag }} - name: Summary run: | echo "Pushed ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.tag }}" >> "$GITHUB_STEP_SUMMARY"