Add: Gitea Actions CI/CD — build & push image, trigger Coolify deploy

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) <noreply@anthropic.com>
This commit is contained in:
2026-04-25 12:38:11 +00:00
parent 5e9963f51b
commit 164c678fa9
+55
View File
@@ -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 }}"