From 1c2666db313de4ea37511fc53b8e90dd7b122dc2 Mon Sep 17 00:00:00 2001 From: Wylabb <77673282+Wylabb@users.noreply.github.com> Date: Tue, 7 Apr 2026 21:59:09 +0200 Subject: [PATCH] Add CI workflow to build and push TS worker image Builds src/worker/Dockerfile and pushes to git.wylab.me/wylab/claw-ts-worker:latest on every push to main. Same pattern as claw-code-parity's build-telegram.yml. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/build-worker.yml | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/build-worker.yml diff --git a/.github/workflows/build-worker.yml b/.github/workflows/build-worker.yml new file mode 100644 index 0000000..a26d56d --- /dev/null +++ b/.github/workflows/build-worker.yml @@ -0,0 +1,61 @@ +name: Build TS Worker + +on: + push: + branches: + - main + paths: + - .github/workflows/build-worker.yml + - src/worker/** + - Dockerfile + - package.json + - bun.lock* + pull_request: + branches: [main] + paths: + - .github/workflows/build-worker.yml + - src/worker/** + - Dockerfile + - package.json + - bun.lock* + workflow_dispatch: + +env: + REGISTRY: git.wylab.me + IMAGE_NAME: wylab/claw-ts-worker + BUILDKIT_PROGRESS: plain + +jobs: + build: + runs-on: [self-hosted, linux-amd64] + timeout-minutes: 15 + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.REGISTRY_USERNAME || github.actor }} + password: ${{ secrets.REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: src/worker/Dockerfile + provenance: false + platforms: linux/amd64 + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max + push: ${{ github.event_name != 'pull_request' }} + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}