Files
ai-torture-chamber/.github/workflows/build-worker.yml
T

55 lines
1.9 KiB
YAML

name: build-worker
# Cloud build for the Saw chamber serverless worker — no local docker needed.
# Builds live/Dockerfile.worker (deps baked: numpy<2, transformers 4.51.3,
# torch 2.4 cu121, runpod) and pushes to ghcr. After the first run, make the
# package public (github.com/users/terrafying/packages) so RunPod can pull
# it anonymously, then point the serverless template at the image.
on:
push:
branches: [master]
paths: ["live/Dockerfile.worker", "live/worker.py", "live/server.py",
"live/requirements.txt", "live/jlens_l18_qwen3-4b.pt",
".github/workflows/build-worker.yml"]
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./live
file: ./live/Dockerfile.worker
push: true
tags: |
ghcr.io/terrafying/saw-chamber-worker:v3
ghcr.io/terrafying/saw-chamber-worker:latest
cache-from: type=gha
cache-to: type=gha,mode=max
# RunPod pulls anonymously, so the package must be public. Code in the
# image is already public via the site tarballs — no new exposure.
- name: Make package public
run: |
curl -sS -o /dev/null -w "%{http_code}\n" -X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/user/packages/container/saw-chamber-worker \
-d '{"package_type":"container","visibility":"public"}' || true