From 164c678fa942ea412555439a1ee39ef88145b836 Mon Sep 17 00:00:00 2001 From: Chaim Date: Sat, 25 Apr 2026 12:38:11 +0000 Subject: [PATCH] =?UTF-8?q?Add:=20Gitea=20Actions=20CI/CD=20=E2=80=94=20bu?= =?UTF-8?q?ild=20&=20push=20image,=20trigger=20Coolify=20deploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pushes to main build a multi-stage Docker image (Node 22 → Python 3.13), push it to gitea.dev.marcus-law.co.il/mcp-servers/nadlan-mcp:latest (plus a build-N tag, plus a vN.N.N tag on git tag pushes), then trigger Coolify to redeploy app b8uf2yysbgeo1un4r9fbwt35. Mirrors the pattern used by Chaim/decisions-court. Repo secrets set: REGISTRY_USER, REGISTRY_PASSWORD, COOLIFY_TOKEN. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/deploy.yaml | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..f2f2549 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,55 @@ +name: Build & Deploy + +on: + push: + branches: [main] + tags: ["v*"] + +env: + REGISTRY: gitea.dev.marcus-law.co.il + IMAGE: mcp-servers/nadlan-mcp + COOLIFY_UUID: b8uf2yysbgeo1un4r9fbwt35 + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Gitea Registry + run: | + echo "${{ secrets.REGISTRY_PASSWORD }}" | \ + docker login ${{ env.REGISTRY }} \ + -u "${{ secrets.REGISTRY_USER }}" --password-stdin + + - name: Build and tag image + run: | + BASE="${{ env.REGISTRY }}/${{ env.IMAGE }}" + TAGS="-t ${BASE}:latest -t ${BASE}:build-${{ github.run_number }}" + + REF="${{ github.ref }}" + if [[ "$REF" == refs/tags/v* ]]; then + VERSION="${REF#refs/tags/}" + TAGS="$TAGS -t ${BASE}:${VERSION}" + fi + + docker build $TAGS . + + - name: Push image + run: | + BASE="${{ env.REGISTRY }}/${{ env.IMAGE }}" + docker push "${BASE}:latest" + docker push "${BASE}:build-${{ github.run_number }}" + + REF="${{ github.ref }}" + if [[ "$REF" == refs/tags/v* ]]; then + VERSION="${REF#refs/tags/}" + docker push "${BASE}:${VERSION}" + fi + + - name: Trigger Coolify redeploy + run: | + curl -sf \ + "http://coolify:8080/api/v1/deploy?uuid=${{ env.COOLIFY_UUID }}&force=true" \ + -H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}"