Some checks failed
Build and Push Docker Images / build-and-push (./archon-ui-main, ./archon-ui-main/Dockerfile, frontend) (push) Failing after 1m45s
Build and Push Docker Images / build-and-push (./python, ./python/Dockerfile.agents, agents) (push) Failing after 6s
Build and Push Docker Images / build-and-push (./python, ./python/Dockerfile.mcp, mcp) (push) Failing after 7s
Build and Push Docker Images / build-and-push (./python, ./python/Dockerfile.server, server) (push) Failing after 6s
Build and Push Docker Images / summary (push) Has been skipped
Test Build / build (push) Failing after 3s
- Add build-push-images.yml workflow for automated builds - Build and push all 4 images (server, mcp, frontend, agents) - Support versioning: latest, semver, commit SHA - Add docker-compose.registry.yml for registry images - Add REGISTRY.md documentation for DevOps team Images will be pushed to: - git.automatizase.com.br/luis.erlacher/archon/server - git.automatizase.com.br/luis.erlacher/archon/mcp - git.automatizase.com.br/luis.erlacher/archon/frontend - git.automatizase.com.br/luis.erlacher/archon/agents 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
124 lines
5.4 KiB
YAML
124 lines
5.4 KiB
YAML
name: Build and Push Docker Images
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
REGISTRY: git.automatizase.com.br
|
|
REGISTRY_PATH: luis.erlacher/archon
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: wsl
|
|
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- name: server
|
|
context: ./python
|
|
dockerfile: ./python/Dockerfile.server
|
|
- name: mcp
|
|
context: ./python
|
|
dockerfile: ./python/Dockerfile.mcp
|
|
- name: frontend
|
|
context: ./archon-ui-main
|
|
dockerfile: ./archon-ui-main/Dockerfile
|
|
- name: agents
|
|
context: ./python
|
|
dockerfile: ./python/Dockerfile.agents
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
run: |
|
|
echo "${{ secrets.GITEA_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ secrets.GITEA_USERNAME }} --password-stdin
|
|
|
|
- name: Extract version metadata
|
|
id: meta
|
|
run: |
|
|
# Se for uma tag, usa a tag como versão
|
|
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
else
|
|
# Senão, gera versão baseada no número do run
|
|
VERSION="v1.0.${{ github.run_number }}"
|
|
fi
|
|
|
|
COMMIT_SHA="${{ github.sha }}"
|
|
SHORT_SHA=${COMMIT_SHA:0:7}
|
|
|
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build and push ${{ matrix.name }} image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ${{ matrix.context }}
|
|
file: ${{ matrix.dockerfile }}
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ matrix.name }}:latest
|
|
${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ matrix.name }}:${{ steps.meta.outputs.version }}
|
|
${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ matrix.name }}:${{ steps.meta.outputs.short_sha }}
|
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ matrix.name }}:buildcache
|
|
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ matrix.name }}:buildcache,mode=max
|
|
|
|
summary:
|
|
needs: build-and-push
|
|
runs-on: wsl
|
|
|
|
steps:
|
|
- name: Extract version metadata
|
|
id: meta
|
|
run: |
|
|
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
else
|
|
VERSION="v1.0.${{ github.run_number }}"
|
|
fi
|
|
COMMIT_SHA="${{ github.sha }}"
|
|
SHORT_SHA=${COMMIT_SHA:0:7}
|
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build Summary
|
|
run: |
|
|
echo "### 🚀 Docker Images Build & Push Summary" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "**Version:** \`${{ steps.meta.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
|
|
echo "**Commit:** \`${{ steps.meta.outputs.short_sha }}\`" >> $GITHUB_STEP_SUMMARY
|
|
echo "**Registry:** \`${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}\`" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "#### 📦 Images Pushed:" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Service | Image | Tags |" >> $GITHUB_STEP_SUMMARY
|
|
echo "|---------|-------|------|" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Server | \`${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/server\` | \`latest\`, \`${{ steps.meta.outputs.version }}\`, \`${{ steps.meta.outputs.short_sha }}\` |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| MCP | \`${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/mcp\` | \`latest\`, \`${{ steps.meta.outputs.version }}\`, \`${{ steps.meta.outputs.short_sha }}\` |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Frontend | \`${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/frontend\` | \`latest\`, \`${{ steps.meta.outputs.version }}\`, \`${{ steps.meta.outputs.short_sha }}\` |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Agents | \`${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/agents\` | \`latest\`, \`${{ steps.meta.outputs.version }}\`, \`${{ steps.meta.outputs.short_sha }}\` |" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "#### 🔧 Docker Compose Usage:" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "\`\`\`yaml" >> $GITHUB_STEP_SUMMARY
|
|
echo "services:" >> $GITHUB_STEP_SUMMARY
|
|
echo " archon-server:" >> $GITHUB_STEP_SUMMARY
|
|
echo " image: ${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/server:${{ steps.meta.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
|
echo " archon-mcp:" >> $GITHUB_STEP_SUMMARY
|
|
echo " image: ${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/mcp:${{ steps.meta.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
|
echo " archon-frontend:" >> $GITHUB_STEP_SUMMARY
|
|
echo " image: ${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/frontend:${{ steps.meta.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
|
echo " archon-agents:" >> $GITHUB_STEP_SUMMARY
|
|
echo " image: ${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/agents:${{ steps.meta.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|