Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
78 lines
2.0 KiB
Markdown
78 lines
2.0 KiB
Markdown
# Phoenix Deploy API — Gitea Integration
|
|
|
|
**Last Updated:** 2026-02-10
|
|
**Status:** Active Documentation
|
|
|
|
---
|
|
|
|
## Overview
|
|
|
|
The Phoenix Deploy API ([phoenix-deploy-api/](../../phoenix-deploy-api/)) receives Gitea webhooks and provides a deploy endpoint for triggering Phoenix deployments from Gitea Actions or external tools.
|
|
|
|
## Architecture
|
|
|
|
```
|
|
Gitea (push/tag) → Webhook → Phoenix Deploy API → (stub: logs/queues)
|
|
↓
|
|
Gitea Commit Status API (pending/success/failure)
|
|
```
|
|
|
|
## Setup
|
|
|
|
### 1. Deploy Phoenix Deploy API
|
|
|
|
Run the service on a host reachable from Gitea (e.g. dev-vm 5700 or Phoenix API host):
|
|
|
|
```bash
|
|
cd phoenix-deploy-api
|
|
npm install
|
|
GITEA_TOKEN=<token> PHOENIX_DEPLOY_SECRET=<secret> npm start
|
|
```
|
|
|
|
Or as systemd service on dev-vm.
|
|
|
|
### 2. Gitea Webhook Configuration
|
|
|
|
**Via script (recommended):**
|
|
|
|
```bash
|
|
# Ensure Phoenix Deploy API is running (e.g. on dev-vm at 192.168.11.59:4001)
|
|
GITEA_TOKEN=xxx PHOENIX_WEBHOOK_URL=http://192.168.11.59:4001/webhook/gitea bash scripts/dev-vm/add-gitea-webhook-phoenix.sh d-bis/proxmox
|
|
```
|
|
|
|
**Manual (per-repository):**
|
|
|
|
1. Gitea → d-bis/proxmox → Settings → Webhooks → Add Webhook
|
|
2. **URL:** `https://<phoenix-deploy-host>/webhook/gitea`
|
|
3. **Content type:** application/json
|
|
4. **Secret:** Optional; set `PHOENIX_DEPLOY_SECRET` to match
|
|
5. **Triggers:** Push events, Tag creation
|
|
|
|
**Organization-level webhook** (if supported): Configure once for all repos in d-bis.
|
|
|
|
### 3. Gitea Token
|
|
|
|
Create a token at https://gitea.d-bis.org/user/settings/applications with scope `repo` (or `repo:status`) for commit status updates.
|
|
|
|
## Deploy Endpoint
|
|
|
|
`POST /api/deploy`
|
|
|
|
**Headers:** `Authorization: Bearer <PHOENIX_DEPLOY_SECRET>`
|
|
|
|
**Body:**
|
|
```json
|
|
{
|
|
"repo": "d-bis/proxmox",
|
|
"branch": "main",
|
|
"sha": "abc123def",
|
|
"target": "default"
|
|
}
|
|
```
|
|
|
|
## Next Steps
|
|
|
|
- Implement full deploy logic (Proxmox SSH, run deploy scripts)
|
|
- Integrate into Sankofa Phoenix API (VMID 8600)
|
|
- Add NPMplus proxy for phoenix-deploy if exposed publicly
|