From a04bd8dedb0cdf88970e8de5bb796645a34481b6 Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Sun, 2 Aug 2026 16:07:38 -0400 Subject: [PATCH] feat: add CI and publish workflows for container image --- .gitea/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++ .gitea/workflows/publish.yml | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 .gitea/workflows/ci.yml create mode 100644 .gitea/workflows/publish.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..200c712 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + - run: pip install ruff + - run: ruff check src/ + - run: ruff format --check src/ + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + cache: pip + - run: pip install -r requirements.txt + - name: Verify imports + run: python -c "from src.server import mcp; print('OK:', mcp.name)" + + docker: + runs-on: ubuntu-latest + needs: [lint, build] + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/build-push-action@v6 + with: + context: . + push: false + tags: poke-mail:test diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml new file mode 100644 index 0000000..ffdca08 --- /dev/null +++ b/.gitea/workflows/publish.yml @@ -0,0 +1,45 @@ +name: Build & Push Container Image + +on: + push: + branches: [main] + tags: ["v*"] + +env: + REGISTRY: git.soconnor.dev + IMAGE_NAME: soconnor/poke-mail + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ gitea.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/metadata-action@v5 + id: meta + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + - uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}