mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 15:26:41 +02:00
feat(infra): add Forgejo for self-hosted Git + CI/CD
- Forgejo v11 on port 3041 (git.mana.how via Cloudflare Tunnel) - Forgejo Runner for CI/CD (GitHub Actions compatible) - Built-in Docker registry and LFS support - Registration disabled (admin-only) - SSH access on port 2222 - Go Services CI workflow (.forgejo/workflows/go-services.yml) - Setup script: scripts/mac-mini/setup-forgejo.sh Replaces GitHub dependency for CI/CD. GitHub can remain as mirror/backup while Forgejo becomes the primary Git host. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4318948980
commit
8d36aba134
4 changed files with 298 additions and 97 deletions
76
.forgejo/workflows/go-services.yml
Normal file
76
.forgejo/workflows/go-services.yml
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
# CI for Go Services
|
||||
# Runs on push to main or PRs — builds and tests all Go services
|
||||
# Compatible with both Forgejo Actions and GitHub Actions
|
||||
|
||||
name: Go Services CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'services/mana-search-go/**'
|
||||
- 'services/mana-notify-go/**'
|
||||
- 'services/mana-crawler-go/**'
|
||||
- 'services/mana-api-gateway-go/**'
|
||||
- 'services/mana-sync/**'
|
||||
- 'services/mana-matrix-bot/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'services/mana-*-go/**'
|
||||
- 'services/mana-sync/**'
|
||||
- 'services/mana-matrix-bot/**'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
service:
|
||||
- mana-search-go
|
||||
- mana-notify-go
|
||||
- mana-crawler-go
|
||||
- mana-api-gateway-go
|
||||
- mana-sync
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Test ${{ matrix.service }}
|
||||
run: |
|
||||
cd services/${{ matrix.service }}
|
||||
go vet ./...
|
||||
go test ./... -v -count=1
|
||||
|
||||
- name: Build ${{ matrix.service }}
|
||||
run: |
|
||||
cd services/${{ matrix.service }}
|
||||
CGO_ENABLED=0 go build -ldflags="-s -w" -o /dev/null ./cmd/server
|
||||
|
||||
docker:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- service: mana-search-go
|
||||
image: mana-search
|
||||
- service: mana-notify-go
|
||||
image: mana-notify
|
||||
- service: mana-crawler-go
|
||||
image: mana-crawler
|
||||
- service: mana-api-gateway-go
|
||||
image: mana-api-gateway
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build \
|
||||
-f services/${{ matrix.service }}/Dockerfile \
|
||||
-t ${{ matrix.image }}:${{ github.sha }} \
|
||||
-t ${{ matrix.image }}:latest \
|
||||
.
|
||||
Loading…
Add table
Add a link
Reference in a new issue