From 43ca1daede2a2cfeec380ca53f0d397da827e06f Mon Sep 17 00:00:00 2001 From: josedario87 <71241187+josedario87@users.noreply.github.com> Date: Wed, 4 Jun 2025 19:39:04 -0600 Subject: [PATCH] Refine workflow cleanup and image names --- .gitea/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ Makefile | 10 ++++++++++ docker-compose.yml | 7 ++++++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/deploy.yml create mode 100644 Makefile diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..505fafc --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy conversation layer + +on: + push: + branches: [ main ] + +jobs: + deploy: + runs-on: docker + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Log in to Gitea registry + run: echo "${{ secrets.GITEA_REGISTRY_PASSWORD }}" | docker login gitea.interno.com -u ${{ secrets.GITEA_REGISTRY_USER }} --password-stdin + - name: Remove old images + run: | + docker rmi -f gitea.interno.com/nucleo000/conversation-whatsapp-router:latest || true + docker rmi -f gitea.interno.com/nucleo000/conversation-chat-ui:latest || true + - name: Mirror open-wa image to Gitea + run: | + docker pull openwa/wa-automate:latest + docker tag openwa/wa-automate:latest gitea.interno.com/nucleo000/conversation-openwa:latest + docker push gitea.interno.com/nucleo000/conversation-openwa:latest + docker rmi openwa/wa-automate:latest + - name: Build and push stack images + run: | + docker compose -p conversation-layer build + docker compose -p conversation-layer push + - name: Deploy stack + run: | + docker compose -p conversation-layer pull + docker compose -p conversation-layer up -d --remove-orphans diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c6b3a5e --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +.PHONY: sync-from-github sync-to-github + +# Pull latest changes from the GitHub mirror and push them to Gitea +sync-from-github: + git pull github main + git push origin main + +# Push local changes to the GitHub mirror +sync-to-github: + git push github main diff --git a/docker-compose.yml b/docker-compose.yml index ef2fdbe..522e421 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,8 @@ version: '3.9' services: openwa: - image: openwa/wa-automate + image: gitea.interno.com/nucleo000/conversation-openwa:latest + container_name: conversation-openwa environment: - WEBHOOK_URL=http://whatsapp-router:3001/webhook - PORT=8080 @@ -13,6 +14,8 @@ services: whatsapp-router: build: ./whatsapp-router + image: gitea.interno.com/nucleo000/conversation-whatsapp-router:latest + container_name: conversation-whatsapp-router environment: - LLM_AGENT_URL=http://llm-agent:8000 - OPEN_WA_URL=http://openwa:8080 @@ -21,6 +24,8 @@ services: chat-ui: build: ./chat-ui + image: gitea.interno.com/nucleo000/conversation-chat-ui:latest + container_name: conversation-chat-ui environment: - LLM_AGENT_URL=http://llm-agent:8000 ports: