From 6d4579da37283b7f6cbe903087393dac8a089dda Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Sun, 22 Mar 2026 20:13:02 -0700 Subject: [PATCH] chore(ci): migrate to Gitea local CI, disable GitHub Actions - Add .gitea/workflows/ci.yml for Gitea Actions - Disable GitHub Actions: ci-extraction-service, ci-mcp-server, reusable-pnpm-workspace - Add docs/devops/GITEA_LOCAL_CI.md setup guide --- .gitea/workflows/ci.yml | 29 +++++ ...yml => ci-extraction-service.yml.disabled} | 0 ...-server.yml => ci-mcp-server.yml.disabled} | 0 ...l => reusable-pnpm-workspace.yml.disabled} | 0 docs/devops/GITEA_LOCAL_CI.md | 112 ++++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 .gitea/workflows/ci.yml rename .github/workflows/{ci-extraction-service.yml => ci-extraction-service.yml.disabled} (100%) rename .github/workflows/{ci-mcp-server.yml => ci-mcp-server.yml.disabled} (100%) rename .github/workflows/{reusable-pnpm-workspace.yml => reusable-pnpm-workspace.yml.disabled} (100%) create mode 100644 docs/devops/GITEA_LOCAL_CI.md diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 00000000..19f2cb10 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI — Common Platform + +on: + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + name: Build, Test & Typecheck + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build all packages + run: pnpm build + + - name: Typecheck + run: pnpm typecheck + + - name: Test + run: pnpm test diff --git a/.github/workflows/ci-extraction-service.yml b/.github/workflows/ci-extraction-service.yml.disabled similarity index 100% rename from .github/workflows/ci-extraction-service.yml rename to .github/workflows/ci-extraction-service.yml.disabled diff --git a/.github/workflows/ci-mcp-server.yml b/.github/workflows/ci-mcp-server.yml.disabled similarity index 100% rename from .github/workflows/ci-mcp-server.yml rename to .github/workflows/ci-mcp-server.yml.disabled diff --git a/.github/workflows/reusable-pnpm-workspace.yml b/.github/workflows/reusable-pnpm-workspace.yml.disabled similarity index 100% rename from .github/workflows/reusable-pnpm-workspace.yml rename to .github/workflows/reusable-pnpm-workspace.yml.disabled diff --git a/docs/devops/GITEA_LOCAL_CI.md b/docs/devops/GITEA_LOCAL_CI.md new file mode 100644 index 00000000..a2475dae --- /dev/null +++ b/docs/devops/GITEA_LOCAL_CI.md @@ -0,0 +1,112 @@ +# Gitea Local CI — Self-Hosted CI for ByteLyst Ecosystem + +## Overview + +Self-hosted Gitea + act_runner replaces GitHub Actions (billing blocked). Runs CI jobs directly on your Mac — no Docker required. + +## Architecture + +| Component | Port | Purpose | +| -------------- | ---- | -------------------------------- | +| **Gitea** | 3300 | Git hosting + Actions engine | +| **act_runner** | — | Executes CI jobs on host (macOS) | + +- **GitHub (`origin`)** — unchanged, primary code hosting +- **Gitea (`gitea`)** — secondary remote, triggers local CI on push + +## Credentials + +- **URL:** http://localhost:3300 +- **Username:** `bytelyst` +- **Password:** `bytelyst123` + +## Quick Commands + +```bash +# Start services +brew services start gitea +brew services start act_runner + +# Stop services +brew services stop act_runner +brew services stop gitea + +# Check status +brew services list | grep -E "gitea|act_runner" + +# Push to trigger CI +git push gitea main +``` + +## Config Locations + +| File | Path | +| ------------------- | --------------------------------------------- | +| Gitea config | `/opt/homebrew/var/gitea/custom/conf/app.ini` | +| Runner config | `/opt/homebrew/etc/act_runner/config.yaml` | +| Runner registration | `/opt/homebrew/var/act_runner/.runner` | +| Gitea data | `/opt/homebrew/var/gitea/data/` | +| Gitea logs | `/opt/homebrew/var/gitea/log/` | +| Job work dir | `~/.cache/act/` | + +## How It Works + +1. You `git push gitea main` from any repo +2. Gitea detects `.gitea/workflows/ci.yml` in the pushed code +3. act_runner picks up the job and runs it on your Mac (host mode) +4. Jobs have access to node, pnpm, python, etc. from your system PATH +5. `@bytelyst/*` packages are built from the local common-plat checkout (`/Users/sd9235/code/mygh/learning_ai_common_plat`) + +## Repos Configured + +All 14 repos have: + +- `gitea` remote → `http://localhost:3300/bytelyst/.git` +- `.gitea/workflows/ci.yml` — Gitea Actions workflow (adapted from GitHub Actions) +- `.github/workflows/ci.yml.disabled` — GitHub Actions disabled + +## Differences from GitHub Actions + +| Feature | GitHub Actions | Gitea Actions | +| -------------------- | ------------------------------------------------ | --------------------------------- | +| Runner | Ubuntu container | macOS host | +| common-plat checkout | `actions/checkout` with `repository:` + `GH_PAT` | Already on disk at `$COMMON_PLAT` | +| Node setup | `actions/setup-node@v4` | Already installed via brew | +| pnpm setup | `pnpm/action-setup@v4` | Already installed via brew | +| Concurrency | Free tier limited | Unlimited (local) | + +## Push to Both Remotes + +To push to both GitHub and Gitea in one command, add a script alias: + +```bash +# Add to ~/.zshrc +gpush() { git push origin main && git push gitea main; } +``` + +## Troubleshooting + +### Runner not picking up jobs + +```bash +brew services restart act_runner +# Check logs +tail -50 /opt/homebrew/var/log/act_runner.log +``` + +### Gitea not responding + +```bash +brew services restart gitea +curl -s http://localhost:3300/api/v1/version +``` + +### Re-register runner + +```bash +brew services stop act_runner +rm /opt/homebrew/var/act_runner/.runner +TOKEN=$(curl -s -u "bytelyst:bytelyst123" http://localhost:3300/api/v1/admin/runners/registration-token | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])") +cd /opt/homebrew/var/act_runner && /opt/homebrew/opt/act_runner/bin/act_runner register --config /opt/homebrew/etc/act_runner/config.yaml --instance http://localhost:3300 --token "$TOKEN" --name bytelyst-mac --no-interactive +brew services start act_runner +```