From e1a98d68ffa3bfb868cf62c1ac0c37f2c5a71b6b Mon Sep 17 00:00:00 2001 From: wylab Date: Fri, 13 Feb 2026 14:25:32 +0100 Subject: [PATCH] ci: add Docker build workflow and fix gateway CMD - Add .github/workflows/build.yml to auto-build and push to Gitea registry - Change Dockerfile.oauth CMD from "status" to "gateway" for persistent container Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++++ Dockerfile.oauth | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..da5dcbd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,46 @@ +name: Build Nanobot OAuth + +on: + push: + branches: ['main'] + workflow_dispatch: + +env: + REGISTRY: git.wylab.me + IMAGE_NAME: wylab/nanobot + 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: Dockerfile.oauth + 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: true + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} diff --git a/Dockerfile.oauth b/Dockerfile.oauth index e26ead9..543912d 100644 --- a/Dockerfile.oauth +++ b/Dockerfile.oauth @@ -8,4 +8,4 @@ COPY nanobot/ /app/nanobot/ RUN uv pip install --system --no-cache --reinstall /app ENTRYPOINT ["nanobot"] -CMD ["status"] +CMD ["gateway"]