Переезд с ghcr.io на встроенный Container Registry Gitea
Build & Push Image / Build and push to Gitea Registry (push) Failing after 15s
Build & Push Image / Build and push to Gitea Registry (push) Failing after 15s
Свой netrunner-landing/netrunner-landing-proxy теперь на gitea.netrunner-vpn.com. Сторонний образ PocketBase (ghcr.io/muchobien/ pocketbase) не трогаю — это чужой образ, живёт там же, где и жил.
This commit is contained in:
+16
-13
@@ -1,6 +1,9 @@
|
|||||||
# Копия .github/workflows/build.yml для Gitea Actions. Логин на ghcr.io — через
|
# Копия .github/workflows/build.yml для Gitea Actions. Реестр — встроенный
|
||||||
# secrets.GHCR_TOKEN (настоящий GitHub PAT с write:packages), не
|
# Container Registry самой Gitea (gitea.netrunner-vpn.com), не ghcr.io —
|
||||||
# secrets.GITHUB_TOKEN — автотокен Gitea валиден только для самого Gitea.
|
# secrets.GITEA_REGISTRY_TOKEN (токен Gitea с правом write:package), не
|
||||||
|
# GHCR_TOKEN/GITHUB_TOKEN. Тот же токен, что и в netrunner-backend/
|
||||||
|
# netrunner-proxy — пакеты в Gitea принадлежат аккаунту, не репозиторию,
|
||||||
|
# но значение секрета нужно продублировать в Settings каждого репозитория.
|
||||||
name: Build & Push Image
|
name: Build & Push Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -10,7 +13,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build and push to GHCR
|
name: Build and push to Gitea Registry
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -24,12 +27,12 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to GHCR
|
- name: Login to Gitea Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: gitea.netrunner-vpn.com
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GHCR_TOKEN }}
|
password: ${{ secrets.GITEA_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
# Сборка Лендинга (Next.js)
|
# Сборка Лендинга (Next.js)
|
||||||
- name: Build and Push Landing
|
- name: Build and Push Landing
|
||||||
@@ -38,9 +41,9 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ghcr.io/nineap/netrunner-landing:latest
|
tags: gitea.netrunner-vpn.com/nineap/netrunner-landing:latest
|
||||||
cache-from: type=registry,ref=ghcr.io/nineap/netrunner-landing:cache
|
cache-from: type=registry,ref=gitea.netrunner-vpn.com/nineap/netrunner-landing:cache
|
||||||
cache-to: type=registry,ref=ghcr.io/nineap/netrunner-landing:cache,mode=max
|
cache-to: type=registry,ref=gitea.netrunner-vpn.com/nineap/netrunner-landing:cache,mode=max
|
||||||
|
|
||||||
# Сборка Прокси (Rust)
|
# Сборка Прокси (Rust)
|
||||||
- name: Build and Push Proxy
|
- name: Build and Push Proxy
|
||||||
@@ -49,6 +52,6 @@ jobs:
|
|||||||
context: ./proxy-ws
|
context: ./proxy-ws
|
||||||
file: ./proxy-ws/Dockerfile
|
file: ./proxy-ws/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ghcr.io/nineap/netrunner-landing-proxy:latest
|
tags: gitea.netrunner-vpn.com/nineap/netrunner-landing-proxy:latest
|
||||||
cache-from: type=registry,ref=ghcr.io/nineap/netrunner-landing-proxy:cache
|
cache-from: type=registry,ref=gitea.netrunner-vpn.com/nineap/netrunner-landing-proxy:cache
|
||||||
cache-to: type=registry,ref=ghcr.io/nineap/netrunner-landing-proxy:cache,mode=max
|
cache-to: type=registry,ref=gitea.netrunner-vpn.com/nineap/netrunner-landing-proxy:cache,mode=max
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Копия .github/workflows/deploy.yml для Gitea Actions.
|
# Копия .github/workflows/deploy.yml для Gitea Actions.
|
||||||
# - secrets.GHCR_TOKEN вместо secrets.GITHUB_TOKEN для логина на ghcr.io —
|
# - Образы тянутся из встроенного Container Registry самой Gitea
|
||||||
# автотокен Gitea валиден только для самого Gitea, не для ghcr.io.
|
# (gitea.netrunner-vpn.com), не ghcr.io — secrets.GITEA_REGISTRY_TOKEN.
|
||||||
# - Триггер workflow_run (авто-деплой после успешной сборки) поддерживается
|
# - Триггер workflow_run (авто-деплой после успешной сборки) поддерживается
|
||||||
# не во всех версиях Gitea Actions — если deploy-dev не срабатывает
|
# не во всех версиях Gitea Actions — если deploy-dev не срабатывает
|
||||||
# автоматически после build, проверить версию Gitea или временно дергать
|
# автоматически после build, проверить версию Gitea или временно дергать
|
||||||
@@ -27,7 +27,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ github.event.workflow_run.head_sha }}
|
ref: ${{ github.event.workflow_run.head_sha }}
|
||||||
|
|
||||||
# Копируем только compose-файл — сам образ дев-сервер тянет из GHCR.
|
# Копируем только compose-файл — сам образ дев-сервер тянет из Gitea Registry.
|
||||||
- name: Sync compose file to Dev VPS
|
- name: Sync compose file to Dev VPS
|
||||||
uses: appleboy/scp-action@v0.1.7
|
uses: appleboy/scp-action@v0.1.7
|
||||||
with:
|
with:
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
chmod 600 .env
|
chmod 600 .env
|
||||||
|
|
||||||
echo "🚀 Deploying landing+proxy:latest to DEV"
|
echo "🚀 Deploying landing+proxy:latest to DEV"
|
||||||
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
|
echo "${{ secrets.GITEA_REGISTRY_TOKEN }}" | docker login gitea.netrunner-vpn.com -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
docker compose -f docker-compose.dev-remote.yml pull
|
docker compose -f docker-compose.dev-remote.yml pull
|
||||||
docker compose -f docker-compose.dev-remote.yml up -d --remove-orphans
|
docker compose -f docker-compose.dev-remote.yml up -d --remove-orphans
|
||||||
@@ -95,7 +95,7 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
set -e
|
set -e
|
||||||
cd /root/netrunner-frontend
|
cd /root/netrunner-frontend
|
||||||
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
echo ${{ secrets.GITEA_REGISTRY_TOKEN }} | docker login gitea.netrunner-vpn.com -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
echo "🚀 Deploying landing+proxy:latest to PROD"
|
echo "🚀 Deploying landing+proxy:latest to PROD"
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
services:
|
services:
|
||||||
# Фронтенд (Next.js)
|
# Фронтенд (Next.js)
|
||||||
landing:
|
landing:
|
||||||
image: ${IMAGE:-ghcr.io/nineap/netrunner-landing:latest}
|
image: ${IMAGE:-gitea.netrunner-vpn.com/nineap/netrunner-landing:latest}
|
||||||
container_name: netrunner-landing-dev
|
container_name: netrunner-landing-dev
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -73,7 +73,7 @@ services:
|
|||||||
|
|
||||||
# Прокси-слой (Rust)
|
# Прокси-слой (Rust)
|
||||||
ws-proxy:
|
ws-proxy:
|
||||||
image: ghcr.io/nineap/netrunner-landing-proxy:latest
|
image: gitea.netrunner-vpn.com/nineap/netrunner-landing-proxy:latest
|
||||||
container_name: netrunner-ws-proxy-dev
|
container_name: netrunner-ws-proxy-dev
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
# Фронтенд (Next.js)
|
# Фронтенд (Next.js)
|
||||||
landing:
|
landing:
|
||||||
image: ghcr.io/nineap/netrunner-landing:latest
|
image: gitea.netrunner-vpn.com/nineap/netrunner-landing:latest
|
||||||
container_name: netrunner-landing
|
container_name: netrunner-landing
|
||||||
restart: always
|
restart: always
|
||||||
# Не 127.0.0.1 — /api/metrics (см. app/api/metrics/route.ts) должен
|
# Не 127.0.0.1 — /api/metrics (см. app/api/metrics/route.ts) должен
|
||||||
@@ -54,7 +54,7 @@ services:
|
|||||||
|
|
||||||
# Прокси-слой (Rust)
|
# Прокси-слой (Rust)
|
||||||
ws-proxy:
|
ws-proxy:
|
||||||
image: ghcr.io/nineap/netrunner-landing-proxy:latest
|
image: gitea.netrunner-vpn.com/nineap/netrunner-landing-proxy:latest
|
||||||
container_name: netrunner-ws-proxy
|
container_name: netrunner-ws-proxy
|
||||||
restart: always
|
restart: always
|
||||||
# Не 127.0.0.1 — /metrics (см. proxy-ws/src/main.rs) должен скрейпиться
|
# Не 127.0.0.1 — /metrics (см. proxy-ws/src/main.rs) должен скрейпиться
|
||||||
|
|||||||
Reference in New Issue
Block a user