feat: Gitea CI workflow + registry image для деплоя

- .gitea/workflows/docker-build.yml: билд и пуш образа в Gitea Container Registry
- docker-compose.server.yml: убрал build context, используем registry image
- Требует REGISTRY_TOKEN секрет в настройках репо

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-01 02:05:31 +03:00
parent 6e97bb9f61
commit 6b38c7b15f
2 changed files with 37 additions and 5 deletions

View File

@@ -0,0 +1,33 @@
name: Build and Push Docker Image
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
env:
GIT_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
SERVER_HOST=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||')
git clone --depth 2 "http://${{ gitea.actor }}:${GIT_TOKEN}@${SERVER_HOST}/${{ gitea.repository }}.git" .
git checkout ${{ gitea.sha }}
- name: Build and push image
run: |
REGISTRY_HOST=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||')
IMAGE="${REGISTRY_HOST}/${{ gitea.repository }}/sing-proxy"
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY_HOST" -u "${{ gitea.actor }}" --password-stdin
docker build \
-f docker/Dockerfile.singbox \
-t "${IMAGE}:latest" \
.
docker push "${IMAGE}:latest"
echo "Pushed: ${IMAGE}:latest"