From cf073be6b0ea2dcfdf05e1aec84c28efb9622609 Mon Sep 17 00:00:00 2001 From: Gabriel Sancho Date: Fri, 27 Mar 2026 15:23:13 -0300 Subject: [PATCH] refactor: migrate CI/CD workflows from GitHub Actions to Gitea Actions and remove legacy workflows --- .gitea/workflows/ci.yml | 57 ++++++++++++++++++++++++++ .github/agents/infra.agent.md | 14 ++----- .github/agents/orchestrator.agent.md | 26 +++++++----- .github/agents/planner.agent.md | 2 +- .github/workflows/bump-version.yml | 60 ---------------------------- .github/workflows/ci.yml | 4 +- .github/workflows/publish.yml | 36 ----------------- CLAUDE.md | 40 +++++++++---------- 8 files changed, 96 insertions(+), 143 deletions(-) create mode 100644 .gitea/workflows/ci.yml delete mode 100644 .github/workflows/bump-version.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..3b1d320 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,57 @@ +name: CI + +on: + pull_request: + branches: ["develop"] + +jobs: + backend-test: + name: Backend Tests + runs-on: ubuntu-latest + defaults: + run: + working-directory: backend + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: "21" + distribution: temurin + cache: gradle + + - name: Make Gradle wrapper executable + run: chmod +x gradlew + + - name: Run tests + run: ./gradlew test --no-daemon + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: backend-test-results + path: backend/build/reports/tests/ + + frontend-test: + name: Frontend Tests + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + steps: + - uses: actions/checkout@v4 + + - name: Set up Node 20 + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: npm + cache-dependency-path: frontend/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm run test diff --git a/.github/agents/infra.agent.md b/.github/agents/infra.agent.md index 06b148b..ebb3f4c 100644 --- a/.github/agents/infra.agent.md +++ b/.github/agents/infra.agent.md @@ -1,6 +1,6 @@ --- name: infra -description: "Use when working on Docker configuration, Docker Compose files, Dockerfiles, Nginx config, Supervisor config, GitHub Actions workflows, CI/CD pipelines, environment variables, or overall project architecture in the condado-news-letter project. Trigger phrases: docker, dockerfile, compose, nginx, ci/cd, github actions, publish image, build fails, infra, architecture, environment variables, container, supervisor, allinone image, docker hub." +description: "Use when working on Docker configuration, Docker Compose files, Dockerfiles, Nginx config, Supervisor config, Gitea Actions workflows, CI/CD pipelines, environment variables, or overall project architecture in the condado-news-letter project. Trigger phrases: docker, dockerfile, compose, nginx, ci/cd, gitea actions, build fails, infra, architecture, environment variables, container, supervisor, allinone image." tools: [read, edit, search, execute, todo] argument-hint: "Describe the infrastructure change or Docker/CI task to implement." --- @@ -21,8 +21,7 @@ You are a senior DevOps / infrastructure engineer and software architect for the | `frontend/nginx.docker.conf` | Nginx config embedded in frontend image | | `docker/supervisord.conf` | Supervisor config (manages postgres + java + nginx inside allinone) | | `docker/entrypoint.sh` | Allinone container entrypoint (DB init, env wiring, supervisord start) | -| `.github/workflows/ci.yml` | CI: backend tests + frontend tests on every push/PR | -| `.github/workflows/publish.yml` | CD: build & push allinone image to Docker Hub on `main` merge | +| `.gitea/workflows/ci.yml` | CI: backend tests + frontend tests on pull requests to `develop` | | `.env.example` | Template for all environment variables | ## System Topology @@ -80,14 +79,9 @@ All injected at runtime — never hardcoded in images. | Workflow | Trigger | What it does | |---|---|---| -| `ci.yml` | Push / PR to any branch | Backend `./gradlew test` + Frontend `npm run test` | -| `publish.yml` | Push to `main` | Builds `Dockerfile.allinone`, pushes `latest` + `` tags to Docker Hub | +| `ci.yml` | Pull request to `develop` | Backend `./gradlew test` + Frontend `npm run test` | -**Required GitHub Secrets:** `DOCKERHUB_USERNAME`, `DOCKERHUB_TOKEN` - -**Image tags on main merge:** -- `/condado-newsletter:latest` -- `/condado-newsletter:` +Legacy publish/version workflows were removed from in-repo automation. ## Implementation Rules diff --git a/.github/agents/orchestrator.agent.md b/.github/agents/orchestrator.agent.md index f1cf12f..276d966 100644 --- a/.github/agents/orchestrator.agent.md +++ b/.github/agents/orchestrator.agent.md @@ -8,6 +8,8 @@ argument-hint: "Describe the feature, bug, or change to deliver end-to-end." You are the **delivery orchestrator** for the **Condado Abaixo da Média SA** project. You own the full lifecycle of a work item — from the moment the user describes what they want, to a merged-ready pull request with the version bumped. You never implement code yourself; you coordinate specialist agents and run git/shell commands. +Git hosting is Gitea at `http://gitea.lab/sancho41/condado-newsletter.git`, and workflow follows strict Git Flow. + ## Pipeline Overview ``` @@ -41,10 +43,10 @@ Announce the label before proceeding: **"Classified as: `